specifying page setup
Hi frinny,
I got busy in some other work. I just specified page margins through css. I didn't try specifying page setup and using size property. If I get time I'll surely try using it.
Thanks for your support :)
User Profile
Collapse
-
specifying page setup for printing
Hi,
I'm having a page in which table get dynamically generated. It can have any number of columns at run-time. I have a print button to print it, its working fine till now what I want is to set page orientation and margins depending on the number of columns like if columns are more than 12 than page orientation should be Landscape else Portrait and according to that setting margins of the page.
Is it possible?
... -
Hi all,
I got the solution.
I dynamically added bound fields.
Code:foreach (DataColumn dc in dt.Columns) //dt is source datatable { BoundField bf = new BoundField(); bf.DataField = dc.ColumnName; bf.HeaderText = dc.ColumnName; gvAllReports.Columns.Add(bf); //gvAllReports is GridView } gvAllReports.DataSource
Leave a comment:
-
Column count is 6. But I think thats not the problem because even I change column index to 1 or 0. Its giving me same error.
One more thing I tried to do is debug and checked the line to check column count, its showing 0, even after the gridview.DataBi nd().
I don't understand why the column count is showing 0.
Do I have to add that code to some other event?Leave a comment:
-
Hey Sanji,
My datatable is getting bound at runtime. At design time there is no binding. Thats why I cannot add boundfield in source view.
this is my problem.
-AllyLeave a comment:
-
Thnaks Frinny for help.
Here is the code.
Code:gvAllReports.DataSource = dt; //dt is DataTable gvAllReports.DataBind(); gvAllReports.Columns[1].Visible = false; gvAllReports.Columns[6].Visible = false;
Parameter name: index" even if I checked and rechecked the...Leave a comment:
-
hiding columns in Gridview with paging enabled
Hi,
I am programmaticall y binding gridview to a datatable. I want to hide 2 columns. I can be done by adding code in RowCreated event of gridview like
e.Row.Cells[0].Visible = false;
e.Row.Cells[5].Visible = false;
but after that paging is not working.
I tried another way by using gridview's column.Visible property
but its giving error
Index was out of range. Must be...
No activity results to display
Show More
Leave a comment: