But I have an issue, I need the grids to fit on the screen of the web browser and they aren't.
I have two radgrids, one that has two columns and another that has about 10+ columns underneath. They are both within a radgrid, when I try to reduce the width nothing works, I have a scroll bar on the bottom the of browser which I don't want. The width of both radgrids are at 100% but the grid extends the screen to double instead of 100% being the screen itself, therefore not working properly.
Is there any way to have the scroll bar on one of the radgrids and not both? I have tried the Client Settings with Scrolling and it's working but I have 4 columns missing. I have also provided some code:
Can I get some help?
12 Answers, 1 is accepted
Hello LiZ0r,
Thank you for the detailed explanation. Can you please check whether setting TableLayout =Fixed for the MasterTableView of the nested grids produces the desired effect? Note that by default the TableLayout is set to Auto and this may cause the grid to expand when having many columns in it.
You may also set fixed width through the embedded grids tags to see whether this makes a difference.
Best regards,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Also wondering, is there a reason why, when no data is avaliable, the radgrid doesn't show all columns.
Is there anyway to fix that?
The grid should show all column headers by default when there is no data available and the NoRecords template is displayed. Simply verify that the ShowHeadersWhenNoRecords property of the master table is set to true (this is its default value).
Kind regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Not sure why that is though....
I also have another problem that has occurred.
In one of my radgrids that is in another grid, the footer is not showing up with all the sums that I have created.
why is that? how do I fix that?
Can you please paste the markup/code-behind of your page (using the 'Format code block' dialog at the top right corner of the forums editor) and provide a live url where the discrepancies can be observed? Thus I will do my best to provide up-to-the-point explanation/fix.
Regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thanks for help!
I don't have a live URL that I can provide that doesn't require username and passwords.Can you see if the code helps but if you need more detail let me know! Thanks again!
I reviewed your code snippets and noticed that the bound column with unique name "AirlineNameForExport" has Display = false setting which will hide it in the grid when rendered and exclude it from the exported document. Additionally, the hyperlink inside the first template column in the second grid will be stripped when you choose ExportOnlyData = true.
Can these details be related to the reason for the abnormality you observed? Note that you can use the tips from this section of the documentation (paragraph 'Exporting GridButtonColumn/GridTemplateColumn/GridHyperLinkColumn data') to display these columns when needed.
Concerning the missing footers:
Can you please share with us how you generate the footer aggregate values? I suppose you calculate them dynamically since you do not seem to use the declarative footer aggregates supported by our web grid. Do you use the programmatic approach from here for this purpose? I will appreciate if you elaborate a bit more on this subject and which values are missing from the footer in order to research the matter additional and provide more definite explanation/solution.
Best regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Hi Sebastian,
First I wanna start off by saying thank you for helping me with my problem.
I have the bound column as "AirlineNameForExport" Display = false because I was hoping for the hyperlink to be shown on the radgrid, but when exported to have just the column name. I had the following to lines in the code behind page:
RadGrid2.MasterTableView.Columns.FindByUniqueName("AirlineName").Display = false;
RadGrid2.MasterTableView.Columns.FindByUniqueName("AirlineNameForExport").Display = true;
But was receiving an error advising that RadGrod2 doesn't exist, and I think this is because it is nested in another grid.
How would I go around this so that I am able to export those columns? I'm not sure if this is the reason for the observed abnormality but I removed it for now because it wasn't working properly.
The missing footers, I managed to fix by setting ShowFooter="True" which show the sum of each column.
I forgot to put in this line, but now that it is in the footers are able to be viewed.
Another problem I am having is that,when I set the width to be 100% I expect to be the size of the page, but it will stretch over and then there will be a horinzontal toolbar on the browser, is this because I have too many columns? Also, I am having difficulties export to PDF or Excel, it just won't export like it should....
To locate the second nested grid and display its hidden column/replace the hyperlink column with hidden GridBoundColumn before the export operation takes place, you can use this code inside the LinkButton2's OnClick server handler:
foreach(GridDataItem dataItem in RadGrid0.MasterTableView.Items) |
{ |
(dataItem.FindControl("RadGrid2") as RadGrid).MasterTableView.Columns.FindByUniqueName("AirlineName").Display = false; |
(dataItem.FindControl("RadGrid2") as RadGrid).MasterTableView.Columns.FindByUniqueName("AirlineNameForExport").Display = true; |
//show or hide other columns in the same manner |
} |
How to set the grid to fit the height of the browser window you can see from the sample project in this code library entry:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/setting-100-height-and-resize-on-container-resize-for-grid-with-scrolling-and-static-headers.aspx
How to customize the exported document appearance you can find out from the information in these resources:
http://www.telerik.com/help/aspnet-ajax/grdexport.html
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx
Best regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
My requirement is that to have a web page like below and i need to export to PDF as it is, as per your comment you achieved this, can you please help me the how to do.
Sno | Class & subject | Marks | |
Class | Subject | ||
1 | |||
2 | |||
3 | |||
Total marks | 0 | ||
Grade | A | ||
Result | Pass | ||
Sno | Cource offered | Fee discount | |
1 | |||
2 | |||
3 | |||
Total Disc | 40% | ||
Total Pay | 0 |
I'll be glad to help.
Have you coded this yet? What problems are you having?
You may want to take a look at creating radgrids to input your data and then I can give you a hand where you are having problems.
Regards,
LiZ0r
same problem occurred with my rad grid.i have rad grid which have around 50 columns.when i print my grid, grid's columns are truncated.
i set GridTableLayout to auto but it is not working.
Please help me.
thanks & regards
Anil Nautiyal