or
I have a radgrid of which I have made the EnableViewstate=false and added the OnNeedDatasource event. One column of the grid has delete buttons which is image button. After disabling the view state the delete button is not working properly. The command argument and command name are not getting set properly. When the delete button is clicked its "OnCommand" event is fired but the command argument sets as empty there.
But it is set properly in the Onitemdatabound event. Under the same changes if i use linkbutton instead, it works fine. Please help.
Regards
Shirish
<
telerik:RadTreeList
ID
=
"rtv"
runat
=
"server"
DataSourceID
=
"SqlDS"
DataKeyNames
=
"ID_ELEMENT"
ParentDataKeyNames
=
"ID_PARENT"
DataMember
=
"DefaultView"
>
<
Columns
>
<
telerik:TreeListBoundColumn
DataField
=
"Name"
HeaderText
=
"Name"
UniqueName
=
"columnName"
ReadOnly
=
"True"
>
</
telerik:TreeListBoundColumn
>
<
telerik:TreeListBoundColumn
DataField
=
"SELECTOR"
HeaderText
=
"SELECTOR"
ReadOnly
=
"True"
DataType
=
"System.Int32"
UniqueName
=
"columnSELECTOR"
Visible
=
"False"
>
</
telerik:TreeListBoundColumn
>
<
telerik:TreeListTemplateColumn
UniqueName
=
"Template"
HeaderText
=
"Template"
DataField
=
"ID_ELEMENT"
>
<
ItemTemplate
>
<
telerik:RadGrid
ID
=
"RadGrid2"
runat
=
"server"
DataSourceID
=
"SqlDS2"
>
<
MasterTableView
DataSourceID
=
"SqlDS2"
></
MasterTableView
>
</
telerik:RadGrid
>
</
ItemTemplate
>
</
telerik:TreeListTemplateColumn
>
</
Columns
>
</
telerik:RadTreeList
>
<
asp:SqlDataSource
ID
=
"SqlDS"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT_COMMAND" SelectCommandType="StoredProcedure">
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDS2"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT_TEMPLATE" SelectCommandType="StoredProcedure">
<
SelectParameters
>
<
asp:Parameter
DefaultValue
=
"0"
Name
=
"PARAM"
Type
=
"Int32"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
Protected Sub ToggleRowSelection(ByVal sender As Object, ByVal e As EventArgs)
CType(CType(sender, CheckBox).NamingContainer, GridItem).Selected = CType(sender, CheckBox).Checked
End Sub
Protected Sub ToggleSelectedState(ByVal sender As Object, ByVal e As EventArgs)
Dim headerCheckBox As CheckBox = CType(sender, CheckBox)
For Each dataItem As GridDataItem In RequestFiles.MasterTableView.Items
CType(dataItem.FindControl("CheckBox1"), CheckBox).Checked = headerCheckBox.Checked
dataItem.Selected = headerCheckBox.Checked
Next
End Sub
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles RequestFiles.PreRender
lblCountRecords.Text = String.Format("<
strong
>{0}</
strong
>", RequestFiles.SelectedItems.Count)
End Sub