I have a RadGrid in which i need to loop through the first column and turn off the on click event.
Prior to grouping this RadGrid the following code did this across each individual row.
CType(CType(Page.Form.FindControl("ReportGrid"), RadGrid).MasterTableView.Items(i).Cells(2), TableCell).Attributes.Add("OnClick", "return false;")
And
CType(Page.Form.FindControl("ReportGrid"), RadGrid).MasterTableView.Items(lastRowCount - j).CssClass = "boldRow"
over the last row in order to bold the sum row.
However now with grouping I cannot locate the appropriate position to set the attribute/cssclass. Also the total row for each group is duplicated twice.
How do I access the first column in each row turn off the OnClick event? And how do I find/access the last row of each group?
thank you.
<telerik:RadGrid ID="ReportGrid" runat="server" AllowSorting="True" AutoGenerateColumns="False"
Skin="Rental" PageSize="100000" GridLines="None" Width="930px" AllowPaging="True"
TabIndex="-1" EnableEmbeddedSkins="false" Height="480px" >
<PagerStyle Position="Bottom" Mode="NumericPages" PageButtonCount="10" AlwaysVisible="true" />
<ClientSettings>
<Scrolling UseStaticHeaders="True" AllowScroll="True" ScrollHeight="430px"></Scrolling>
<Resizing ResizeGridOnColumnResize="True" ClipCellContentOnResize="False" />
</ClientSettings>
<SortingSettings EnableSkinSortStyles="false" />
<MasterTableView AllowCustomSorting="true" AllowMultiColumnSorting="false" EnableNoRecordsTemplate="False" GridLines="Vertical" DataKeyNames="regionid" TableLayout="Fixed">
<SortExpressions>
<telerik:GridSortExpression FieldName="Product" SortOrder="Ascending" />
</SortExpressions>
<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldAlias="Product" FieldName="Product" SortOrder="Ascending"></telerik:GridGroupByField>
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="ProductSort" SortOrder="Descending"></telerik:GridGroupByField>
</GroupByFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>
<NoRecordsTemplate>
There is no data to display.
</NoRecordsTemplate>
<Columns>
<telerik:GridButtonColumn ButtonType="LinkButton" ImageUrl="" HeaderText="Region"
DataTextField="RegionName" ItemStyle-CssClass="GrdBtn" CommandName="Select" UniqueName="btnSelect" SortExpression="Name"
HeaderStyle-Width="150px" />
<telerik:GridBoundColumn DataField="Size" HeaderText="Size" UniqueName="Size"
SortExpression="Util">
<HeaderStyle Width="60px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Util" HeaderText="Util" UniqueName="Util"
SortExpression="Util">
<HeaderStyle Width="60px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Lol" HeaderText="Lol" UniqueName="Lol"
SortExpression="Lol">
<HeaderStyle Width="60px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ConLength" HeaderText="ConLength over Time" UniqueName="ConLength"
SortExpression="ConLength">
<HeaderStyle Width="60px" />
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>