We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Record navigation control

Hi, I have attached RecordNavigationCOtrol with DataboundGrid.I am dynamically loading data. When there is no data in the grid and when i click next arrow button it goes on displaying 1,2... I dont want to display anything when there is no data. or can we disable the arrow buttons and not the complete navigation bar. How do we do that? When the splitter is attached with between the RecordNavigationControl and Some other control. It hides part of the Navigation bar.How can this be avoided?

3 Replies

AD Administrator Syncfusion Team April 19, 2005 03:50 AM

Normally, the gridrecnav control will handle enabling and disabling the buttons for you depending upon the number of rows in the grid and where the current row is. You might want to try to figure out why that is not working in your case. In version 3010, if I drop a griddataboundgrid into a gridrecordnavigation control at runtime, but do not set its datasource until I click a button on the form at runtime, then the navbar is disabled and I do not see the 1,2,3.. you are describing. If you can upload a little sample showing this not working, or tell us how to see it in one of our samples, we can maybe suggest a solution. If you want to try to disable buttons, you can use code like this to do so: this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[0].Enabled = false; this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[1].Enabled = false; this.gridRecordNavigationControl1.NavigationBar.Invalidate(); As far as a slpitter covering a control, are you talking about a splitter outside the recnavcontrol? If so, one thing you could do is to place a panel where you have the recnavcontrol, set its DockPadding to add some space around the edge next to the splitter and then set the recnav control into the panle with the recnav Dock property set to fill. Then you can control the spacing using the panel.DockPadding property.


AD Administrator Syncfusion Team April 19, 2005 05:54 AM

Thanx, How do we aceess the next and last navigation button this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[2] and Button[3] >Normally, the gridrecnav control will handle enabling and disabling the buttons for you depending upon the number of rows in the grid and where the current row is. You might want to try to figure out why that is not working in your case. In version 3010, if I drop a griddataboundgrid into a gridrecordnavigation control at runtime, but do not set its datasource until I click a button on the form at runtime, then the navbar is disabled and I do not see the 1,2,3.. you are describing. If you can upload a little sample showing this not working, or tell us how to see it in one of our samples, we can maybe suggest a solution. > >If you want to try to disable buttons, you can use code like this to do so: > >this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[0].Enabled = false; >this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[1].Enabled = false; >this.gridRecordNavigationControl1.NavigationBar.Invalidate(); > > >As far as a slpitter covering a control, are you talking about a splitter outside the recnavcontrol? If so, one thing you could do is to place a panel where you have the recnavcontrol, set its DockPadding to add some space around the edge next to the splitter and then set the recnav control into the panle with the recnav Dock property set to fill. Then you can control the spacing using the panel.DockPadding property.


AD Administrator Syncfusion Team April 19, 2005 06:15 AM

Here are the indexes and the buttons. 0 First 1 Previous 2 Syncfusion.Windows.Forms.InternalButton 3 null 4 Syncfusion.Windows.Forms.InternalButton 5 Next 6 Last 7 AddNew Here is the code used to generate this list.
Syncfusion.Windows.Forms.InternalButton button;
for(int i = 0; 
	i < this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons.GetLength(0);
	++i)
{
	button = this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons[i];
	if(button == null)
		Console.WriteLine("{0} null", i);
	else
		Console.WriteLine("{0} {1}", i, button.ToString());
}

Loader.
Live Chat Icon For mobile
Up arrow icon