Gridview not rendered

jayderamu

New Member
I have bound gridview to Linq result and set AutoGenerateColumns to true and Enabled Viewstate for the grid view and Still not rendered at all ,Html in browser shows empty\[code\] <div></div>\[/code\]What is weird is that in ASP.NET development server in file system it is VISIBLE with no problem but When I hosted it in Internet it is not !!\[code\]<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <asp:asyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers><ContentTemplate > <asp:GridView dir="rtl" ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" CellPadding="4" AutoGenerateColumns="true" ForeColor="#333333" GridLines="Vertical" ViewStateMode="Enabled" Width="917px" style=" padding-bottom:20px;" EnableViewState="True"> <AlternatingRowStyle BackColor="White" /> <EditRowStyle BackColor="#2461BF" /> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Right" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <RowStyle BackColor="#EFF3FB" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <SortedAscendingCellStyle BackColor="#F5F7FB" /> <SortedAscendingHeaderStyle BackColor="#6D95E1" /> <SortedDescendingCellStyle BackColor="#E9EBEF" /> <SortedDescendingHeaderStyle BackColor="#4870BE" /></asp:GridView> <br /> <br /></ContentTemplate></asp:UpdatePanel>\[/code\]By the way I tried also to remove the Ajax control but It did not solve the problemThe Linq code is pretty complicated but I can Show you this\[code\] tmp = (From p In results Where p.ShowProduct Select New With {.?????? = p.ProductName, .????? = If(p.Setting.ShowPrices, If(p.ShowPrice, (p.SellPrice * p.Setting.ConversionToDollar).ToString, " - "), " - "), .?????? = If(p.Setting.ShowCounts, If(p.ShowCount, CSng(p.Count) & " " & p.Unit, " - "), " - "), .????? = p.Category, .????? = p.Description, .?????? = p.Manufacturer, .????? = If(p.Setting.ShowAddress, If(p.Setting.ShowMobile, p.Setting.NameOfShop & "/" & p.Setting.ShopAddress & "/" & p.Setting.Mobile, p.Setting.NameOfShop & "/" & p.Setting.ShopAddress & "/ -"), If(p.Setting.ShowMobile, p.Setting.NameOfShop & "/ - /" & p.Setting.Mobile, p.Setting.NameOfShop & "/ - / - ")), .??????? = p.LastUpdate}).ToList.OrderByDescending(Function(n) n.GetType().GetProperty(GridViewSortExpression).GetValue(n, Nothing)).ToList End If 'Format currency and date cells ' Dim dgvcs1 As New TableItemStyle ' Dim dgvcs2 As New DataGridViewCellStyle ' dgvcs2.Format = "d" ' DataGridView2.Columns("???????").DefaultCellStyle = dgvcs1 ' DataGridView2.Columns("?????").DefaultCellStyle = dgvcs1 ' DataGridView2.Columns("????????").DefaultCellStyle = dgvcs2 ' DataGridView2.Columns("???????").DefaultCellStyle = dgvcs2 ResultCount = results.Count GridView1.DataSource = tmp ' GridView1.ViewStateMode = UI.ViewStateMode.Enabled GridView1.DataBind()\[/code\]I also tried to put this line of code \[code\] UpdatePanel1.Update()\[/code\]Please help me
 
Back
Top