fixing <asp:gridview> header row and selecting rows at client side

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnuSumesh
    New Member
    • Aug 2007
    • 96

    fixing <asp:gridview> header row and selecting rows at client side

    Hi All,

    I am using <asp:Gridview > to display my data.
    I am adding columns and rows dynamically.
    I am facing following issues:
    1.
    I want scrollbars around the gridview and for this purpose i used <div style="overflow :auto"> and its working fine. But issue is that the header row also scroll down with scrollbar and i want to fix header row .
    I searched on google and found a lot of solutions but nothing is working for me.
    I am using css for header row and setting position:relati ve.
    Its working fine in mozilla but when using in IE, the header row is growing out of gridview boundaries horizontally when horizontal scrollbar appears. Vertically working fine.

    2.
    I am using commandfield to select the row.
    But I want to select the row at client side in such a way that when i click on command button, it should not go to server for processing., rather it should selecet the row using client side code only.


    Please help me in solving above issues.

    Thanks & Regards,
    Anu
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    This is a lot trickier than you would first think.

    First of all, I would recommend against using CSS in an attempt to position your headers. The reason is because CSS works differently in each browser. I spent literally days trying to get this to to work with CSS and got so frustrated that I started my control over from scratch.

    So yeah, I gave up on using CSS and created a separate table to use as the header row instead.

    Now, the client side select is fun :)
    You get to muck around with JavaScript now.

    I just finished implementing a solution that selects a row client side, displays a control that allows the user to pick some settings for that row, and then posts back to the server.

    You're going to end up using your own controls to do this instead of depending on the GridView.

    This is a journey that is not quick to implement either....

    We should concentrate on one topic for this thread and once that is solved start a new thread for the next topic.

    Comment

    • AnuSumesh
      New Member
      • Aug 2007
      • 96

      #3
      Thanks For Reply.

      Actually we have developed a control with gridview and using that control in whole web site. And our project is also complete.
      But now we want to just modify that control which renders GridView on the page.

      Can you please help me first in giving "Fixed Header" Solution of this problem?
      I don't have much practice in this area but this task is given to me and i have to complete it.

      Your help will be much appreciated.

      Thanks,
      Anu

      Comment

      • alamodgal
        New Member
        • Dec 2008
        • 38

        #4
        Please check this link


        Comment

        • alamodgal
          New Member
          • Dec 2008
          • 38

          #5
          In this link you get how to scroll gridview with fixed header

          Comment

          • AnuSumesh
            New Member
            • Aug 2007
            • 96

            #6
            Hi

            Thanks to All. I have solved my Fixed header issue
            Refer to link


            Now next issue is selecting row at client side without going to server side.

            Any help on this issue.

            Thanks & Regards,
            Anu

            Comment

            Working...