Hi,
I want to convert all the rows in the wingrid to the new List.
List<class> newcl = new List<class>();
This above class contains all the columns names corresponding to the ultragridrow
Intially i got all the data from the wingrid to datadgridrow
List<UltraGridRow> ugr = new List<UltraGridRow>();
foreach (UltraGridRow row in grid.Rows) { ugr.Add(row); }
From this ugr i don't know how to convert to the new List. I need some sample code for this solution.
This looks to be a similar question that you asked here:http://forums.infragistics.com/forums/t/23604.aspx
What are you trying to accomplish here? You can likely get a list of your underlying data by inspecting the grid's DataSource, without needing to go through the grid's Rows collection. For that matter, the grid's Rows collection is already a strongly-typed collection of UltraGridRow objects.
If you can provide us with a better idea as to what you're trying to do, we can better guide you.
Thanks for your reply.
i will explain my question in a detailed manner.
For showing the data we are using the wingrid. As you very well that, we can do anything in the wingrid.
Things we are doing in the wingrid
- Changing the position of the columns - Sorting any columns by ascending or descending
We are getting the data through a list. by means of list we are showing the data in the wingrid.
In that wingrid we have the print option.This will print the data in the HTML format.
For printing we are using the same list to print the data.
Problem
Initially when u give the print screen, it will print the data whatever in the list. but when u change the position of the columns or sort any of the columns, the list is not getting updated, since we set the property for the ascending and descending and for changing the position of the columns, we are using the aftercolposchanged event to do that work.
Solution :( what i am trying to do)
while clicking the print button, i am trying to take all the rows as well as the column headers from the wingrid and store it in a List. since we are using the list to show the value in HTML format.
so i required all the rows and column header in a list. so i can make a loop to get the value.
i am unable to convert the wingrid row to the new list.
Help me how to do that... need a sample to proceed.
If u want more information, let me know.
There are a few other options available besides trying to create a List<UltraGridRow> collection, all of which are likely to be much easier to implement:
By the way, is there a reason why you're not using the grid's built-in printing functionality? I assume that there is, if you need to generate an HTML output. I ask just in case it's something you hadn't considered, since nearly all of the work of putting the output to the printer (or print preview) is already done for you.