.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to Fix header row in Gridview within Panel using VS 2008 and .Net 3.5 in web page?

Posted By: mkb     Posted Date: May 27, 2011    Points:5   Category :ASP.Net
Hi,

I display many columns in table dynamically form database and fixing the header using 'offset' style. It works ok with if there is no horizonal scroll of the grid inside panel. But if the horizonatal scroll bar is required the header row becomes expanded and displays out of table or panel.

On net there is soultion given using <Div> but it does not work on all browsers. We even can not get same consistancy with IE version as well. Please guide us.

Thanks in advance.

Responses
Author: Maverick             
Posted Date: May 29, 2011     Points: 20   

Hello,

Can you please post your code sample to get more clarity.

Thanks,
Maverick
Author: mkb             
Posted Date: May 30, 2011     Points: 20   

Hello,

For your information we are using Master page and the code given is for Panel within grid in .aspx page. The columns are binded with dataset. The code is as follows.

<table>
<tr>

<td class="Tab1" colspan="12" style="text-align: center; width: 900px;">

<asp:Panel ID="Panel7" runat="server" ScrollBars="Auto" Width="900px" Height="200px">

<asp:GridView ID="MainGridView" runat="server" AllowSorting="True" AutoGenerateColumns="False"

DataKeyNames="EstimateID" OnRowDataBound="MainGridView_RowDataBound" OnSorting="MainGridView_Sorting"

Style="text-align: center" Width="100%">

<Columns>

<asp:TemplateField>

<EditItemTemplate>

<asp:CheckBox ID="chkBox" runat="server" />

</EditItemTemplate>

<ItemStyle Width="30px"></ItemStyle>


<ItemTemplate>

<asp:CheckBox ID="chkBox" runat="server"></asp:CheckBox>

</ItemTemplate>

</asp:TemplateField>

<asp:BoundField DataField="EstimateDate" SortExpression="EstimateDate" HeaderText="Estimate Date">

<ItemStyle HorizontalAlign="Center"></ItemStyle>


</asp:BoundField>

<asp:TemplateField SortExpression="EstimateNo" HeaderText="Estimate No">

<ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>

<ItemTemplate>

<asp:LinkButton ID="lnkEstimate" runat="server" Text='<%# Eval("EstimateNo") %>'

OnClick="lnkEstimate_Click"></asp:LinkButton>

</ItemTemplate>


</asp:TemplateField>

<asp:BoundField DataField="Campaign" SortExpression="Campaign" HeaderText="Campaign">

<ItemStyle HorizontalAlign="Left"></ItemStyle>

</asp:BoundField>

<asp:BoundField DataField="EstimateFrom" SortExpression="EstimateFrom" HeaderText="Estimate From">

<ItemStyle HorizontalAlign="Center"></ItemStyle>


</asp:BoundField>

<asp:BoundField DataField="EstimateTo" SortExpression="EstimateTo" HeaderText="Estimate To">

<ItemStyle HorizontalAlign="Center"></ItemStyle>


</asp:BoundField>

<asp:BoundField DataField="Client" SortExpression="Client" HeaderText="Client">

<ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>


</asp:BoundField>

<asp:BoundField DataField="Advertiser" SortExpression="Advertiser" HeaderText="Advertiser">

<ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>


</asp:BoundField>

<asp:BoundField DataField="Brand" SortExpression="Brand" HeaderText="Brand">

<ItemStyle HorizontalAlign="Left"></ItemStyle>

</asp:BoundField>

<asp:BoundField DataField="TotalAmt" SortExpression="TotalAmt" HeaderText="Total Amount">

<ItemStyle HorizontalAlign="Right"></ItemStyle>


</asp:BoundField>

<asp:BoundField DataField="EstimateStatus" SortExpression="EstimateStatus" HeaderText="Estimate Status">

<ItemStyle HorizontalAlign="Left"></ItemStyle>

</asp:BoundField>

<asp:BoundField DataField="AvailableCreditLimit" SortExpression="AvailableCreditLimit"

HeaderText="Ag.Comm.(%)">

<ItemStyle HorizontalAlign="Right"></ItemStyle>

</asp:BoundField>

<asp:BoundField DataField="Remarks" SortExpression="Remarks" HeaderText="Remarks">

<ItemStyle HorizontalAlign="Left"></ItemStyle>

</asp:BoundField>

<asp:BoundField DataField="ClientPONo" SortExpression="ClientPONo" HeaderText="ClientPONo">

<ItemStyle HorizontalAlign="Left"></ItemStyle>

</asp:BoundField>

<asp:BoundField DataField="ScheduleStatus" SortExpression="ScheduleStatus" HeaderText="Schedule Status">

<ItemStyle HorizontalAlign="Left"></ItemStyle>

</asp:BoundField>

</Columns>


</asp:GridView>

</asp:Panel>

&nbsp;

</td>

</tr>
</table>


Thanks,
MKB



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend