or
<
style
type
=
"text/css"
>
.rbBlue .rbText {
color: blue;
}
.rbRed .rbText {
color: red;
}
</
style
>
<
telerik:RadButton
ID
=
"FillerNLF"
runat
=
"server"
AutoPostBack
=
"false"
Text
=
"NLF"
ButtonType
=
"ToggleButton"
checked
=
"false"
ToggleType
=
"CheckBox"
Style
=
"font-size: 14px; top: 30px; left: 4px; position: absolute;"
>
<
ToggleStates
>
<
telerik:RadButtonToggleState
PrimaryIconUrl
=
"../Images/layer_transparent.jpeg"
CssClass
=
"rbBlue"
/>
<
telerik:RadButtonToggleState
PrimaryIconCssClass
=
"rbOk"
Selected
=
"true"
CssClass
=
"rbRed"
/>
</
ToggleStates
>
</
telerik:RadButton
>
protected void SaveButton_Click(object sender, EventArgs e)
{
foreach (GridItem item in RadGrid1.Items)
{
if (item.IsInEditMode)
{
GridEditableItem editedItem = (GridEditableItem)item;
Hashtable newValues = new Hashtable();
editedItem.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
// I need to get the value in Column1 on the edited row.
string ReadOnlyCell = ["Column1"].toString();
string ChangedCell = newValues["Column2"].ToString();
// will update SQL here...
editedItem.Edit = false;
}
}
RadGrid1.Rebind();
}
Dim
o_LineDeleteItem
As
New
LinkButton
With
{.Text =
"Del"
, .ID =
String
.Format(
"Delete|"
& __Item.DataItem(
"slc_ID"
).ToString), .CommandName =
"DeleteLineItem"
, .CommandArgument = __Item.DataItem(
"slc_ID"
).ToString}
__Item(
"Options"
).Controls.Add(o_LineDeleteItem)
private void BindToDataTable(RadTreeView RadTreeView1)
{
RadTreeView1.DataSource = "";
RadTreeView1.DataBind();
int UserId = Convert.ToInt32(Session["UserId"].ToString());
int RoleId = Convert.ToInt32(Session["RoleId"].ToString());
Temp = objGlobas.BindTreeView_Test(UserId, RoleId);
//Get Permission to logged in user individually and by group and combine these Entities into one datatable dt2
Globas ObjGlobas = new Globas();
DataTable dtViewPermission = new DataTable();
dtViewPermission = ObjGlobas.ViewPermission(UserId);
DataTable RootNode = new DataTable();
RootNode = Temp;
DataView dView = new DataView(RootNode);
string[] arrColumns = { "CompName", "CompId" };
RootNode = dView.ToTable(true, arrColumns);
if (Convert.ToInt32(Session["RoleId"]) == 1)
{
DataTable dtchildnode = new DataTable();
if (Temp.Rows.Count > 0 && Temp != null)
{
foreach (DataRow row in RootNode.Rows)
{
RadTreeNode tnparent = null;
string ParentNode = row["CompName"].ToString().Trim();
string ParentID = row["CompId"].ToString().Trim();
tnparent = new RadTreeNode(ParentNode);
tnparent.Value = ParentID.ToString();
RadTreeView1.Nodes.Add(tnparent);
tnparent.AllowEdit = false;
tnparent.ContextMenuID = "contextMenu1";
int CompanyId = Convert.ToInt32(ParentID);
dtchildnode = ObjGlobas.BindTreeView_SuperUser(CompanyId);
foreach (DataRow dr in dtchildnode.Rows)
{
RadTreeNode Child = null;
string child = dr["EntityName"].ToString();
string EntityId = dr["EntityId"].ToString();
Child = new RadTreeNode(child);
Child.Value = EntityId;
tnparent.Nodes.Add(Child);
Child.ContextMenuID = "contextMenu2";
}
}
}
}
else
{
if (Temp.Rows.Count > 0 && Temp != null)
{
foreach (DataRow row in RootNode.Rows)
{
RadTreeNode tnparent = null;
string ParentNode = row["CompName"].ToString().Trim();
string ParentID = row["CompId"].ToString().Trim();
tnparent = new RadTreeNode(ParentNode);
tnparent.Value = ParentID.ToString();
RadTreeView1.Nodes.Add(tnparent);
tnparent.AllowEdit = false;
tnparent.ContextMenuID = "contextMenu1";
foreach (DataRow dr in dtViewPermission.Rows)
{
RadTreeNode Child = null;
string child = dr["EntityName"].ToString();
string EntityId = dr["EntityId"].ToString();
Child = new RadTreeNode(child);
Child.Value = EntityId;
tnparent.Nodes.Add(Child);
Child.ContextMenuID = "contextMenu2";
}
}
}
}
}
<
telerik:GridTemplateColumn
HeaderStyle-Width
=
"20%"
UniqueName
=
"ButtonSet"
>
<
ItemTemplate
>
<
telerik:RadButton
runat
=
"server"
id
=
"Button1"
CommandName
=
"Action1"
AutoPostBack
=
"true"
CausesValidation
=
"false"
OnClientClicked
=
"clientclick"
></
telerik:RadButton
>
<
telerik:RadButton
runat
=
"server"
id
=
"Button2"
CommandName
=
"Action2"
AutoPostBack
=
"true"
></
telerik:RadButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:AjaxSetting
AjaxControlID
=
"Button1
"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"label"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
if (e.CommandName == "Action1")
{
//do sth
}
else if (e.CommandName == "Action1")
{
//do sth