Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > regarding datagrid with link button in item template

Reply
Thread Tools

regarding datagrid with link button in item template

 
 
vinodkumarmyakala vinodkumarmyakala is offline
Junior Member
Join Date: Nov 2006
Posts: 2
 
      11-14-2006
hi !
this is vinod,
in datagrid i am getting three fields (as captions from,subject,date) subject i took linkbutton(it is itemtemplate)
there are no of subject related fields in that subject column.
my problem:
when i am clicking the subject link button in the grid all the linkbutton messages are displayed in the grid2 control in which iam retriveing . but i want the particular subject linkbuttons data to be displayed in the grid2.


this is my source code for a datagrid
<aspataGrid ID="DataGrid1" runat="server" AutoGenerateColumns="False" Height="269px"
Style="z-index: 108; left: 313px; position: absolute; top: 130px" Width="628px" AllowSorting="True">
<Columns>
<asp:TemplateColumn >

<ItemTemplate>
<asp:Label ID="order" Visible="false"
Text='<%# DataBinder.Eval (Container.DataItem, "count1") %>'
runat="server" />

</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn >

<HeaderTemplate>From</HeaderTemplate>
<ItemTemplate>

<asp:Label ID="L2" BorderStyle ="None" BorderWidth ="0" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"fromu ser") %>' />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn >
<HeaderTemplate> Subject </HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="L3" BorderStyle ="None" CommandArgument="10" BorderWidth ="0" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"subje ct") %>' OnClick="L3_Click" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn >
<HeaderTemplate> Date </HeaderTemplate>
<ItemTemplate>
<asp:Label ID="L4" BorderStyle ="None" BorderWidth ="0" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"date" ) %>' />
</ItemTemplate>
</asp:TemplateColumn>

</Columns>
</aspataGrid>


and for linkbutton my code is:
string sql = "select entiredata from compose where subject = '" + la + "' and touser = '" + Session["x"] + "'";
SqlDataAdapter da = new SqlDataAdapter(sql, con);
con.Open();
// SqlDataReader dr;
// dr = da.ExecuteReader();
da.Fill(ds, "compose");

GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();


con.Close();
regards
vinod((E-Mail Removed))
 

Last edited by vinodkumarmyakala; 11-14-2006 at 06:35 AM..
Reply With Quote
 
 
 
 
vinodkumarmyakala vinodkumarmyakala is offline
Junior Member
Join Date: Nov 2006
Posts: 2
 
      11-14-2006
send reply to http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 2.0 GridView Item Template CheckBox Radio Button ABHIJIT B ASP .Net 2 02-05-2008 07:00 PM
Command button inside data list item template Shahid Saleem ASP .Net 1 09-01-2005 02:16 PM
item template and edit delete button jijis ASP .Net Datagrid Control 0 03-26-2005 01:35 PM
Setting Radio Button In A Item Template Of A DataList pierre.basson@psitek.com ASP .Net 3 02-02-2005 03:03 PM
Change style of a single row of the item list of datagrid, based on a field value of current item... QUASAR ASP .Net Datagrid Control 6 01-17-2004 07:46 PM



Advertisments