User Profile

Collapse

Profile Sidebar

Collapse
ally
ally
Last Activity: Apr 19 '10, 07:10 AM
Joined: Dec 5 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ally
    replied to specifying page setup for printing
    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 :)
    See more | Go to post

    Leave a comment:


  • ally
    started a topic specifying page setup for printing

    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?
    ...
    See more | Go to post

  • 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
    ...
    See more | Go to post

    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?
    See more | Go to post

    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.

    -Ally
    See more | Go to post

    Leave 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;
    it gives error "Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index" even if I checked and rechecked the...
    See more | Go to post

    Leave a comment:


  • ally
    started a topic hiding columns in Gridview with paging enabled

    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...
    See more | Go to post
No activity results to display
Show More
Working...