1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

need help in asp.net

Discussion in 'C#' started by i_am_dhaval, Jul 16, 2009.

  1. #1
    i need to build table data...

    mens data come in grid..

    on the top of the table ther is is header line

    under the header line all data come in row..

    now i have to develop when i scroll the data header will not scroll

    Head 1 head 2 head 3 this part not scroll (header need fix)

    a1 a2 a3 scroll


    b1 b2 b3 scroll

    c1 c2 c3 scroll

    d1 d2 d3 scroll

    e1 e2 e3 scroll




    in short i need Fixed header in ASP.NET DataGrid.
     
    i_am_dhaval, Jul 16, 2009 IP
  2. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #2
    I searched for the above terms and found many solutions @ http://tinyurl.com/l7gk45
     
    Social.Network, Jul 16, 2009 IP
  3. i_am_dhaval

    i_am_dhaval Well-Known Member

    Messages:
    1,364
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    138
    #3
    i try that form google but not work for firefox

    do you have sample code that works
     
    i_am_dhaval, Jul 16, 2009 IP
  4. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
  5. i_am_dhaval

    i_am_dhaval Well-Known Member

    Messages:
    1,364
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    138
    #5
    i_am_dhaval, Jul 17, 2009 IP
  6. i_am_dhaval

    i_am_dhaval Well-Known Member

    Messages:
    1,364
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    138
    #6
    here is the code it not working in firefox as we as IE 8

    i want to fix the heder

    <asp:Panel ID="Panel1" runat="server" ScrollBars="Both" Height="300" Width="100%">
    <asp:GridView ID="grdsuspect" runat="server" AllowSorting="True" AutoGenerateColumns="False" CssClass="Grid"
    BorderColor="#DDDDDD" BorderStyle="Solid" BorderWidth="0px" CellPadding="3" DataKeyNames="crm_suspects_detail_id"
    EmptyDataText="No Data Found" GridLines="None" Height="1px" PageSize="13" Width="97%" UseAccessibleHeader="true">
    <EmptyDataRowStyle BorderWidth="1px" CssClass="grdemptyitemstyle" ForeColor="Black"
    HorizontalAlign="Center" VerticalAlign="Middle" Width="100px" />
    <Columns>
    <asp:TemplateField>
    <HeaderTemplate>
    Date Input
    </HeaderTemplate>
    <ItemStyle BorderColor="#DDDDDD" BorderWidth="1px" CssClass="grditemstyle" HorizontalAlign="left" />
    <HeaderStyle BorderColor="#DDDDDD" BorderWidth="1px" Font-Bold="False" HorizontalAlign="Left"
    Width="10%" />
    <ItemTemplate>
    <asp:Label ID="lbldate" runat="server" CssClass='<%#IIf(DataBinder.Eval(Container.DataItem, "datdiff") >= DataBinder.Eval(Container.DataItem, "no_suspect_reg"), "grditemstylered", "grditemstyle")%>'
    Text='<%# Eval("created_date") %>'></asp:Label>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField>
    <HeaderTemplate>
    Company Name
    </HeaderTemplate>
    <ItemStyle BorderColor="#DDDDDD" BorderWidth="1px" CssClass="grditemstyle" HorizontalAlign="left" />
    <HeaderStyle BorderColor="#DDDDDD" BorderWidth="1px" Font-Bold="False" HorizontalAlign="Left"
    Width="25%" />
    <ItemTemplate>
    <asp:LinkButton ID="lnksuscontectEdit" runat="server" CausesValidation="false" CommandArgument='Edit'
    CommandName="Edit" CssClass="grditemstyle" Text='<%# Eval("company_name") %>'></asp:LinkButton>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="contactname" HeaderText="Contact Name">
    <ItemStyle BorderColor="#DDDDDD" BorderWidth="1px" CssClass="grditemstyle" Font-Bold="False"
    HorizontalAlign="Left" VerticalAlign="Top" />
    <HeaderStyle BorderColor="#DDDDDD" BorderWidth="1px" Font-Bold="False" HorizontalAlign="Left"
    Width="15%" />
    </asp:BoundField>
    <asp:BoundField DataField="city" HeaderText="Town\City">
    <ItemStyle BorderColor="#DDDDDD" BorderWidth="1px" CssClass="grditemstyle" Font-Bold="False"
    HorizontalAlign="Left" VerticalAlign="Top" />
    <HeaderStyle BorderColor="#DDDDDD" BorderWidth="1px" Font-Bold="False" HorizontalAlign="Left"
    Width="10%" />
    </asp:BoundField>
    <asp:BoundField DataField="postcode" HeaderText="Post Code">
    <ItemStyle BorderColor="#DDDDDD" BorderWidth="1px" CssClass="grditemstyle" Font-Bold="False"
    HorizontalAlign="Left" VerticalAlign="Top" />
    <HeaderStyle BorderColor="#DDDDDD" BorderWidth="1px" Font-Bold="False" HorizontalAlign="Left"
    Width="10%" />
    </asp:BoundField>
    <asp:BoundField DataField="phone" HeaderText="Phone">
    <ItemStyle BorderColor="#DDDDDD" BorderWidth="1px" CssClass="grditemstyle" Font-Bold="False"
    HorizontalAlign="Left" VerticalAlign="Top" />
    <HeaderStyle BorderColor="#DDDDDD" BorderWidth="1px" Font-Bold="False" HorizontalAlign="Left"
    Width="20%" />
    </asp:BoundField>
    <asp:TemplateField>
    <HeaderTemplate>
    Select
    </HeaderTemplate>
    <ItemTemplate>
    <input name="MyRadioButton" type="radio" value='<%# Eval("crm_suspects_detail_id") %>' />
    </ItemTemplate>
    <HeaderStyle BorderColor="#DDDDDD" BorderWidth="1px" Font-Bold="False" HorizontalAlign="Center" />
    <ItemStyle BorderColor="#DDDDDD" BorderWidth="1px" CssClass="grditemstyle" HorizontalAlign="Center" />
    </asp:TemplateField>
    </Columns>
    <RowStyle BackColor="Transparent" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
    <PagerStyle BorderColor="#DDDDDD" BorderStyle="Solid" BorderWidth="0px" CssClass="grditemstyle"
    HorizontalAlign="Right" />
    <HeaderStyle BackColor="White" CssClass="grdhdrstyle DataGridFixedHeader" Font-Bold="False"
    HorizontalAlign="Left" />
    <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    </asp:Panel>
    Code (markup):

    -------------

    Try
    Dim cmdsqlcmd As New SqlCommand("[ts_crm_suspects_details_LoadAll_by_user_id]", MyConn)
    cmdsqlcmd.CommandType = CommandType.StoredProcedure
    cmdsqlcmd.Parameters.Add(New SqlParameter("@company_name", Data.SqlDbType.NVarChar, 250)).Value = ""
    cmdsqlcmd.Parameters.Add(New SqlParameter("@crm_company_country_id", Data.SqlDbType.Int)).Value = "5"
    cmdsqlcmd.Parameters.Add(New SqlParameter("@crm_company_group_id", Data.SqlDbType.Int)).Value = Convert.ToInt32(Session("group_id"))
    cmdsqlcmd.Parameters.Add(New SqlParameter("@is_deleted", Data.SqlDbType.Bit)).Value = False
    cmdsqlcmd.Parameters.Add(New SqlParameter("@flag", Data.SqlDbType.Int)).Value = 2
    cmdsqlcmd.Parameters.Add(New SqlParameter("@user_id", Data.SqlDbType.Int)).Value = 3
    Dim da = New SqlDataAdapter(cmdsqlcmd)
    Dim dt As New DataTable()
    da.Fill(dt)
    grdsuspect.DataSource = dt
    grdsuspect.DataBind()
    Session("searchtext") = ""
    Catch ex As Exception
    ''lblError.Text = ex.Message
    End Try
    Code (markup):
     
    i_am_dhaval, Jul 21, 2009 IP
  7. ziv

    ziv Peon

    Messages:
    18
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7

    The are some free JQeury grids that can replace DataGrid.
    You can try one of these
    jqGrid - http://www.trirand.com/blog/?page_id=5
    flexigrid - http://www.flexigrid.info
     
    ziv, Jul 22, 2009 IP
  8. i_am_dhaval

    i_am_dhaval Well-Known Member

    Messages:
    1,364
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    138
    #8
    can anyone please check my coding ? please help me

    what's wrong with my coding?
     
    i_am_dhaval, Jul 22, 2009 IP