Hi Team,
I have a aradgrid with some bound columns, CheckBox column and ClientSelect Column
What I want is, when I select All Rows (by clicking select all), i dont want some of the rows to get selected based on the values in my CheckBox column.
And I want this functionality from client side.
I tried this with server side DataBound Event and it worked (though not completly.)
here is my aspx :
And I have reached upto this :
I have a aradgrid with some bound columns, CheckBox column and ClientSelect Column
What I want is, when I select All Rows (by clicking select all), i dont want some of the rows to get selected based on the values in my CheckBox column.
And I want this functionality from client side.
I tried this with server side DataBound Event and it worked (though not completly.)
here is my aspx :
<
telerik:RadGrid
ID
=
"rgProjectBudget"
runat
=
"server"
AllowFilteringByColumn
=
"true"
AllowMultiRowSelection
=
"true"
AllowPaging
=
"true"
OnNeedDataSource
=
"rgProjectBudget_NeedDataSource"
OnDeleteCommand
=
"rgProjectBudget_DeleteCommand"
PageSize
=
"50"
OnItemDataBound
=
"rgProjectBudget_ItemDataBound"
OnPreRender
=
"rgProjectBudget_PreRender"
PagerStyle-AlwaysVisible
=
"true"
>
<
ClientSettings
Selecting-AllowRowSelect
=
"true"
>
<
ClientEvents
OnRowSelected
=
"RowSelected"
/>
</
ClientSettings
>
<
MasterTableView
EditMode
=
"InPlace"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"COABudgetDetailID"
DataType
=
"System.Int32"
HeaderText
=
"COABudgetDetailID"
Display
=
"false"
UniqueName
=
"COABudgetDetailID"
AutoPostBackOnFilter
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"EntityKeyName"
DataType
=
"System.String"
FilterControlWidth
=
"40%"
HeaderText
=
"Project Name"
AllowFiltering
=
"true"
AutoPostBackOnFilter
=
"true"
CurrentFilterFunction
=
"Contains"
UniqueName
=
"EntityKeyName"
>
<
HeaderStyle
Width
=
"32%"
HorizontalAlign
=
"Left"
/>
<
ItemStyle
Width
=
"32%"
HorizontalAlign
=
"Left"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ChartOfAccountSetDetailValueCode"
DataType
=
"System.String"
HeaderText
=
"Project Heads"
AllowFiltering
=
"true"
AutoPostBackOnFilter
=
"true"
FilterControlWidth
=
"30%"
CurrentFilterFunction
=
"Contains"
UniqueName
=
"ChartOfAccountSetDetailValueCode"
>
<
HeaderStyle
Width
=
"10%"
HorizontalAlign
=
"Left"
/>
<
ItemStyle
Width
=
"10%"
HorizontalAlign
=
"Left"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ChartOfAccountSetDetailDescription"
DataType
=
"System.String"
HeaderText
=
"Description"
AllowFiltering
=
"true"
AutoPostBackOnFilter
=
"true"
CurrentFilterFunction
=
"Contains"
UniqueName
=
"ChartOfAccountSetDetailDescription"
FilterControlWidth
=
"60%"
>
<
HeaderStyle
Width
=
"20%"
HorizontalAlign
=
"Left"
/>
<
ItemStyle
Width
=
"20%"
HorizontalAlign
=
"Left"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"QuotedValue"
HeaderText
=
"Quoted Amount"
DataField
=
"QuotedValue"
CurrentFilterFunction
=
"EqualTo"
AllowFiltering
=
"true"
DataType
=
"System.Double"
FilterControlWidth
=
"30%"
AutoPostBackOnFilter
=
"true"
>
<
HeaderStyle
Width
=
"10%"
HorizontalAlign
=
"Left"
/>
<
ItemStyle
Width
=
"10%"
HorizontalAlign
=
"Left"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Project Budget"
UniqueName
=
"SecondaryEntityBudget"
DataField
=
"SecondaryEntityBudget"
CurrentFilterFunction
=
"Contains"
AllowFiltering
=
"true"
AutoPostBackOnFilter
=
"true"
>
<
ItemStyle
Width
=
"10%"
/>
<
ItemTemplate
>
<
asp:TextBox
ID
=
"txtBudgetAmount"
runat
=
"server"
Width
=
"70px"
Text='<%# DataBinder.Eval(Container,"DataItem.SecondaryEntityBudget") %>' />
</
ItemTemplate
>
<
HeaderStyle
Width
=
"10%"
HorizontalAlign
=
"Left"
/>
<
ItemStyle
Width
=
"10%"
HorizontalAlign
=
"Left"
/>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"COAActualAmount"
HeaderText
=
"Actual Amount"
DataField
=
"COAActualAmount"
CurrentFilterFunction
=
"EqualTo"
AllowFiltering
=
"true"
DataType
=
"System.Double"
FilterControlWidth
=
"30%"
AutoPostBackOnFilter
=
"true"
>
<
HeaderStyle
Width
=
"10%"
HorizontalAlign
=
"Left"
/>
<
ItemStyle
Width
=
"10%"
HorizontalAlign
=
"Left"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Supplementary Budget1"
UniqueName
=
"SupplementaryBudget1"
Display
=
"true"
DataField
=
"SupplementaryBudget1"
CurrentFilterFunction
=
"Contains"
AllowFiltering
=
"true"
AutoPostBackOnFilter
=
"true"
>
<
ItemStyle
Width
=
"20%"
/>
<
ItemTemplate
>
<
asp:TextBox
ID
=
"txtSupplementaryBudget1"
runat
=
"server"
Width
=
"70px"
Enabled
=
"false"
Text='<%# DataBinder.Eval(Container,"DataItem.SupplementaryBudget1") %>' />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Supplementary Budget2"
UniqueName
=
"SupplementaryBudget2"
Display
=
"true"
DataField
=
"SupplementaryBudget2"
CurrentFilterFunction
=
"Contains"
AllowFiltering
=
"true"
AutoPostBackOnFilter
=
"true"
>
<
ItemStyle
Width
=
"20%"
/>
<
ItemTemplate
>
<
asp:TextBox
ID
=
"txtSupplementaryBudget2"
runat
=
"server"
Width
=
"70px"
Enabled
=
"false"
Text='<%# DataBinder.Eval(Container,"DataItem.SupplementaryBudget2") %>' />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"StatusID"
DataType
=
"System.Int32"
HeaderText
=
"StatusID"
UniqueName
=
"StatusID"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridHyperLinkColumn
DataTextField
=
"StatusName"
DataType
=
"System.String"
ItemStyle-HorizontalAlign
=
"Center"
HeaderText
=
"Status"
UniqueName
=
"StatusName"
CurrentFilterFunction
=
"Contains"
AutoPostBackOnFilter
=
"true"
DataNavigateUrlFields
=
"COABudgetDetailID,SecondaryEntityBudget,SupplementaryBudget1,SupplementaryBudget2"
DataNavigateUrlFormatString
=
"javascript:CheckBudgetAmount({0},{1},{2},{3});"
>
</
telerik:GridHyperLinkColumn
>
<
telerik:GridBoundColumn
DataField
=
"SecondaryEntityBudgetApproved"
DataType
=
"System.Double"
Display
=
"false"
HeaderText
=
"SecondaryEntityBudgetApproved"
UniqueName
=
"SecondaryEntityBudgetApproved"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SupplementaryBudget1Approved"
DataType
=
"System.Double"
Display
=
"false"
HeaderText
=
"SupplementaryBudget1Approved"
UniqueName
=
"SupplementaryBudget1Approved"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SupplementaryBudget2Approved"
DataType
=
"System.Double"
Display
=
"false"
HeaderText
=
"SupplementaryBudget2Approved"
UniqueName
=
"SupplementaryBudget2Approved"
>
</
telerik:GridBoundColumn
>
<%--<
telerik:GridBoundColumn
DataField
=
"StatusName"
DataType
=
"System.String"
HeaderText
=
"Status"
UniqueName
=
"Status"
>
</
telerik:GridBoundColumn
>--%>
<
telerik:GridTemplateColumn
HeaderText
=
"Not Applicable"
UniqueName
=
"IsBudgetNotApplicable"
FilterControlWidth
=
"20%"
CurrentFilterFunction
=
"Contains"
AllowFiltering
=
"true"
AutoPostBackOnFilter
=
"true"
Display
=
"false"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"chkApplicable"
runat
=
"server"
Checked='<%# DataBinder.Eval(Container,"DataItem.IsBudgetNotApplicable") %>' />
</
ItemTemplate
>
<
ItemStyle
HorizontalAlign
=
"Left"
Width
=
"5%"
/>
<
HeaderStyle
Width
=
"5%"
/>
</
telerik:GridTemplateColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"IsParent"
UniqueName
=
"IsParent"
HeaderText
=
"IsParent"
Visible
=
"true"
>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridClientSelectColumn
HeaderText
=
"Select"
UniqueName
=
"Select"
>
</
telerik:GridClientSelectColumn
>
<
telerik:GridButtonColumn
CommandName
=
"Delete"
HeaderText
=
"Delete?"
Text
=
"Delete"
UniqueName
=
"DeleteCommandColumn"
ButtonType
=
"ImageButton"
ConfirmText
=
"Are you sure you want to delete ?"
>
<
ItemStyle
HorizontalAlign
=
"Left"
Width
=
"5%"
/>
<
HeaderStyle
Width
=
"5%"
/>
</
telerik:GridButtonColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
And I have reached upto this :
function RowSelected(sender, eventArgs)
{
var grid = sender;
var MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
var cell = MasterTable.getCellByColumnUniqueName(row, "IsParent");
//here cell.innerHTML holds the value of the cell
alert(cell.innerHTML);
// cell.innerHTML doe not return value of CheckBox Column
// but returns value if its a bound column
}
Waiting for your reply.
Regards,
Lok..