Hi Randy Wang
,
Thanks for
your interest in Syncfusion products.
Please
have the below sample to achieve your requirement of “Jump to a certain record”. We are selecting the row based on the value
entered in the textbox and the scrollbar is scrolled automatically based on the
selected row. Please refer the below code snippet for selecting the particular
row.
Code
snippet:
this.GridGroupingControl1.CurrentTable.Records[s].SetCurrent();
Sample link: http://www.syncfusion.com/downloads/Support/DirectTrac/95417/simple sample grid web-368499202.zip
Please let us know if you have any concerns.
Regards,
Maithiliy K
Me.GridGroupingControl2.CurrentTable.Records(30).SetCurrent()
The only different, I can see between the sample code and mine is that mine uses a SQL datasource and the sample does not. Mine is done in PreRender and the sample is in Load (which I cannot do).
Unfortunately I cannot run the sample code or any code downloaded from the site because the projects reference controls with version 10.404.0.53 while my install version is 10.404.0.71. I tried to replace the assembly in web.config but that didn't work either.
I was provided a javascript by support and that seems to work but I think the SetCurrent solution is better. I would rather used that than sending javascript to the client to set the position. The javascript is:
<script type='text/javascript'>
$(document).ready(function () {
$(__TableScrollerCollection.scrollers[0].vscrollDiv).scrollTop (__gridTable.tableElement.rows[row#].offsetTop);
});
</script>
Hi Randy Wang,
Thanks for your update.
We suggest you to set ReCreateChildControls property as true in order to resolve your reported issue. Please refer the below code snippet.
[C#]
protected void Page_PreRender(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtbox.Text))
{
if ((Convert.ToInt16(txtbox.Text) > 30))
MessageBox.Show("Enter the row index value with 30");
else
{
s = Convert.ToInt16(txtbox.Text);
this.GridGroupingControl1.CurrentTable.Records[s].SetCurrent();
}
}
this.GridGroupingControl1.ReCreateChildControls = true;
}
Please try the above code and let me know if you have any concerns.
Regards,
Bala Murugan A.S
Me.GridGroupingControl2.DataSource = GenerateDataSource()Me.GridGroupingControl2.DataBind()
Me.GridGroupingControl2.CurrentTable.Records(30).SetCurrent()Me.GridGroupingControl2.ReCreateChildControls = True
<TableDescriptor AllowNew="false" AllowEdit="false" TopLevelGroupOptions-ShowCaption="false">
<syncfusion:GridColumnDescriptor HeaderText="Contact Name" MappingName="ContactName" Width="100"></syncfusion:GridColumnDescriptor>
</syncfusion:GridGroupingControl>
Hi Randy Wang,
Thanks for your update.
We regret for the inconvenience caused. We are unable to reproduce your reported issue in our end. We have prepared a simple sample to demonstrate this and the same can be downloaded from the below link.
Sample: JumpToRecord.zip
Please try the above sample and if still issue exist, could you please try to reproduce your issue in the above sample and send back to us.
Please let us know if you have any concerns.
Regards,
Bala Murugan A.S