Hi all,
Now, i want to set focus first item in each pages of Grid. My grid is below:
1. ASPX page:
<telerik:RadGrid
Width="99.8%" ID="radGridControl"
runat="server"
AutoGenerateColumns="true"
AllowPaging="True"
AllowMultiRowSelection="True"
CellPadding="0" PageSize="10"
AllowFilteringByColumn="true"
OnPreRender ="radGridControl_PreRender"
>
<MasterTableView IsFilterItemExpanded="false" Font-Bold="False" TableLayout="Fixed">
<Columns>
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
<ItemTemplate>
<asp:CheckBox ID="chkItem" runat="server" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True"/>
</HeaderTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="True">
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowSelected="RowSelected" />
<Scrolling
AllowScroll="True"
ScrollHeight="320"
EnableVirtualScrollPaging="True"
UseStaticHeaders="True" />
</ClientSettings>
<AlternatingItemStyle Height="20px" />
<ItemStyle Height="20px" />
<HeaderStyle Height="20px" CssClass="hoanguyen-GridStyleRow" Font-Bold="True" />
</telerik:RadGrid>
2. Code-behid:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
radGridControl.Rebind();
if (radGridControl.MasterTableView.Items[0] != null)
{
radGridControl.MasterTableView.Items[0].Focus();
}
}
}
3. I only focus first item with "CheckBox" column of first page. This column can't focus when page Scrolling is next page.
Can you help me to implement this problem?
Thank you!
Mr PhuongLD
Now, i want to set focus first item in each pages of Grid. My grid is below:
1. ASPX page:
<telerik:RadGrid
Width="99.8%" ID="radGridControl"
runat="server"
AutoGenerateColumns="true"
AllowPaging="True"
AllowMultiRowSelection="True"
CellPadding="0" PageSize="10"
AllowFilteringByColumn="true"
OnPreRender ="radGridControl_PreRender"
>
<MasterTableView IsFilterItemExpanded="false" Font-Bold="False" TableLayout="Fixed">
<Columns>
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
<ItemTemplate>
<asp:CheckBox ID="chkItem" runat="server" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True"/>
</HeaderTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="True">
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowSelected="RowSelected" />
<Scrolling
AllowScroll="True"
ScrollHeight="320"
EnableVirtualScrollPaging="True"
UseStaticHeaders="True" />
</ClientSettings>
<AlternatingItemStyle Height="20px" />
<ItemStyle Height="20px" />
<HeaderStyle Height="20px" CssClass="hoanguyen-GridStyleRow" Font-Bold="True" />
</telerik:RadGrid>
2. Code-behid:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
radGridControl.Rebind();
if (radGridControl.MasterTableView.Items[0] != null)
{
radGridControl.MasterTableView.Items[0].Focus();
}
}
}
3. I only focus first item with "CheckBox" column of first page. This column can't focus when page Scrolling is next page.
Can you help me to implement this problem?
Thank you!
Mr PhuongLD