Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
XML
<asp:GridView runat="server" ID="gvrecords"  AutoGenerateColumns="false"
HeaderStyle-BackColor="#7779AF" HeaderStyle-ForeColor="White" DataKeyNames="DocketNo" AllowPaging="True" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<a href ='<%#"UpdateDocket.aspx?DocketNo="+DataBinder.Eval(Container.DataItem,"DocketNo") %>'> <%#Eval("DocketNo") %>  </a>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Branch" HeaderText="Branch" />
<asp:BoundField DataField="Date" HeaderText="Date" />
<asp:BoundField DataField="PinCode" HeaderText="PinCode" />
<asp:BoundField DataField="Basis" HeaderText="Basis" />
<asp:BoundField DataField="To" HeaderText="To" />
<asp:BoundField DataField="ConsignorCode" HeaderText="ConsignorCode" />
<asp:BoundField DataField="Consigee" HeaderText="Consignee" />
<asp:BoundField DataField="PKTS" HeaderText="PKTS" />
<asp:BoundField DataField="ActWT" HeaderText="ActWt" />
<asp:BoundField DataField="ChargeWt" HeaderText="ChargeWt" />
<asp:BoundField DataField="TotalFreight" HeaderText="TotalFreight" />
<asp:BoundField DataField="GoodsType" HeaderText="GoodsType" />
<asp:BoundField DataField="CODamount" HeaderText="CODamount" />
</Columns>
</asp:GridView>

I have a label above this gridview which Shows me which branch is this I want that GridView Shows only that branch result which is the label.
Posted
Comments
King Fisher 21-Nov-14 2:44am    
sorry,i can't catch you update your Question
Member 11111143 21-Nov-14 2:57am    
<div>
<asp:Label ID="lb1" runat="server" Text="Label">

User Details


<table border="1" style="border-collapse: collapse; width: 369px;" cellspacing="1">
<tr>
<td width="77" height="16" align="left" >Name:</td>
<td width="77" height="16" align="left" > <asp:Label
ID="lbl_UserName" runat="server" Font-Bold="True"><br />
</td>

<td width="77" height="16" align="left" >StaffCode:</td>
<td width="77" height="16" align="left" > <asp:Label
ID="lbl_address" runat="server" Font-Bold="True"><br />
</td>

<td width="77" height="16" align="left" >Branch:</td>
<td width="77" height="16" align="left" > <asp:Label
ID="lbl_sal" runat="server" Font-Bold="True"><br />
</td>

<td width="77" height="16" align="left" >Designation:</td>
<td width="77" height="16" align="left" > <asp:Label
ID="lbl_phone" runat="server" Font-Bold="True"><br />
</td>
<td> <asp:TextBox ID="TextBox1" runat="server">

<script type="text/javascript">
// a startup script to get put everything in motion
window.setTimeout("ShowTime()", 1000);
</script>
</td>
</tr>
</table>
</div>
lbl_sal Shows me which Branch Does the user has login .I want to show only that branch gridview details . Sir How it is possible
King Fisher 21-Nov-14 3:03am    
and what's your Query to bind the Gridview?
Laiju k 21-Nov-14 3:06am    
grid has many rows then there shall be many branch
King Fisher 21-Nov-14 4:05am    
why don't you modify your Query Based on Your Branch Name ?

1 solution

select column1name,column2name,.. from CreateDocket where Branch='"+lbl_sal.Text+"'

instead of select * from CreateDocket



Accept Solution if it helped.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900