This is a migrated thread and some comments may be shown as answers.

RadGridView Header

6 Answers 135 Views
GridView
This is a migrated thread and some comments may be shown as answers.
sarag
Top achievements
Rank 1
sarag asked on 10 Feb 2011, 09:55 PM
Hi,

Is there any can i generate Gridview column dynamically from code.

thanks
sarag.

6 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 11 Feb 2011, 07:32 AM
Hi sarag,

You may handle the AutoGeneratingColumn event of the grid. Furthermore, you may take a look at our online documentation for a reference on the definitions of the columns in the code behind.
  

Kind regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
sarag
Top achievements
Rank 1
answered on 11 Feb 2011, 04:53 PM
Hi Maya,

Thanks for your quick reply,
i have another requirement, i have two buttons , forward, backward buttons, using these buttons i want to scroll the gridview. I am Using WPF RadGridview, 

thanks 
sarag
0
Maya
Telerik team
answered on 11 Feb 2011, 05:00 PM
Hello sarag,

You may use the ScrollIntoView method of the grid and scroll to the desired item.
 

All the best,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
sarag
Top achievements
Rank 1
answered on 11 Feb 2011, 08:22 PM
Hi Maya,

I tried with ScrollintoView, but its not working, can i have a sample app,  with 2 buttons and a RadGridview having 50 columns, at startup grid has to show 10 columns , i want to hide the grid horizontal scroll bar, users can scroll using the buttons.  each button click i need to set horizontaloffset value to 5

** my gridview virtualization is turned off.

thanks
sarag
0
Maya
Telerik team
answered on 15 Feb 2011, 06:29 PM
Hello sarag,

Another possible approach would be to handle the click event in some way like:

int rightCount = 0;
private void Button2_Click(object sender, RoutedEventArgs e)
{
rightCount = rightCount + 50;
var scrollViewer = this.playersGrid.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault();
var horizontalOffset = rightCount;
scrollViewer.ScrollToHorizontalOffset(horizontalOffset);
}

 

Kind regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
sarag
Top achievements
Rank 1
answered on 16 Feb 2011, 03:04 AM
thanks that works for me.
Tags
GridView
Asked by
sarag
Top achievements
Rank 1
Answers by
Maya
Telerik team
sarag
Top achievements
Rank 1
Share this question
or