Hide Insert Button:
z.b. in selecting Event of radgrid:
gvPrefSupCalc.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false;
Hide Editbutton :
protected void radGrid_OnItemDataBound(object sender, GridItemEventArgs e)
{
GridItem curItem = e.Item;
if (curItem.ItemType == GridItemType.Item || curItem.ItemType == GridItemType.AlternatingItem)
{
bool editButtonVisible=null!=curItem.DataItem; //or convert Dataitem to your rowtype and add other conditions
LinkButton btnDeleteItem = curItem.FindControl("btnDeleteItem") as LinkButton;
if (btnDeleteItem != null)
{
btnDeleteItem.Visible = editButtonVisible;
}
ImageButton btnEdit = curItem.FindControl("EditButton") as ImageButton;
if (btnEdit != null)
{
btnEdit.Visible = editButtonVisible;
}
}
}
meine Sys/Db admin & Developper Notitzen - wer Rechtschreibfehler findet darf sie behalten ... my Sys/Db Admin and developper notes - I don't care about typos
Thursday, July 25, 2013
asp.net: Finding Controls rekursiv - Controls rekursiv suchen
asp.net c#:
public void FindImageButton(ControlCollection cc)
{
foreach (Control c in cc)
{
ImageButton ib=c as ImageButton;
if (null!=ib)
{
string s= ib.ID;
}
LinkButton lb = c as LinkButton;
if (null != lb)
{
string s = lb.ID;
}
Button b = c as Button;
if (null != b)
{
string s = b.ID;
}
FindImageButton(c.Controls);
}
}
public void FindImageButton(ControlCollection cc)
{
foreach (Control c in cc)
{
ImageButton ib=c as ImageButton;
if (null!=ib)
{
string s= ib.ID;
}
LinkButton lb = c as LinkButton;
if (null != lb)
{
string s = lb.ID;
}
Button b = c as Button;
if (null != b)
{
string s = b.ID;
}
FindImageButton(c.Controls);
}
}
Monday, July 01, 2013
Mulivalue Parameter + "In" Filter
to filter a SSRS (Sql Server Reporting Services) dataset with the In Clause and a Multivalueparameter (e.g. named DocIds) enter [@DocIds] in the Value Box of the Filter (Dataset Properties) and the Operator In.
[@DocIds] is like Expression =Parameters!DocIds.Value - it offers all values of the multivalue Parameter, not only one like Parameters!DocIds.Value(0)
um ein SSRS (Sql Server Reporting Services) Dataset mit der In Klausel und einem Multivalue Parameter (z.b. Namens DocID) zu filtern, muß man [@DocIds] in der Value Textbox und den Operator "In" im Dialogfeld "Filters" der Dataset Properties einstellen.
[@DocIds] entspricht der Expression =Parameters!DocIds.Value - das gibt alle Werte des Multivalue Parameters zurück und nciht nur einen wie z.b. Parameters!DocIds.Value(0)
[@DocIds] is like Expression =Parameters!DocIds.Value - it offers all values of the multivalue Parameter, not only one like Parameters!DocIds.Value(0)
um ein SSRS (Sql Server Reporting Services) Dataset mit der In Klausel und einem Multivalue Parameter (z.b. Namens DocID) zu filtern, muß man [@DocIds] in der Value Textbox und den Operator "In" im Dialogfeld "Filters" der Dataset Properties einstellen.
[@DocIds] entspricht der Expression =Parameters!DocIds.Value - das gibt alle Werte des Multivalue Parameters zurück und nciht nur einen wie z.b. Parameters!DocIds.Value(0)
Subscribe to:
Posts (Atom)