1)i am using a gridview.i had used a button field in the last column( converted into template field)..on clicking on send button i need following functionalities
1) my dropdownlist contains two values(qualified/disqualifed)..when i press send button of any row...an emai should be send to the particular email id of that row..and sms should be sent on mobile no of that person of that row..
for eg if press in the first row .then i need to send all the values of first row along with dropdownlist value through email and sms to the email and mobile no of the person of the first row.....please kindky help me out......thanks in advance....is
it necessary to convert button field into template field..
<asp:LinkButton ID="lBtnSend" OnClick="lBtnSend_Click" runat="server"
CommandArgument='<%#Eval("Uniq filed name like auto increament field") %>'>Edit</asp:LinkButton>
CommandArgument : you can pass any field value in commangeArgument pass here uniq id from your table.
<asp:LinkButton ID="lBtnSend" OnClick="lBtnSend_Click" runat="server"
CommandArgument='<%#Eval("Uniq filed name like auto increament field") %>'>Edit</asp:LinkButton>
CommandArgument : you can pass any field value in commangeArgument pass here uniq id from your table.
int id=Convert.ToInt32(edit.CommandArgument); //Here you get your Uniq Id which is Passed from
CommandArgument of GRid View.
Now here pass the select query
select email,mobile from table where id=id
//Send Email & Send Sms.
}
sir had i had to use link button inside gridview...or outside gridview......and if outside gridview how can i get the values of the row of the row which is clicked..please if u can explain me...
Rounak Rana
Member
48 Points
237 Posts
How to get values of gridview on clicking of a button inside gridview
Oct 16, 2012 07:58 AM|LINK
Hii
1)i am using a gridview.i had used a button field in the last column( converted into template field)..on clicking on send button i need following functionalities
1) my dropdownlist contains two values(qualified/disqualifed)..when i press send button of any row...an emai should be send to the particular email id of that row..and sms should be sent on mobile no of that person of that row..
for eg if press in the first row .then i need to send all the values of first row along with dropdownlist value through email and sms to the email and mobile no of the person of the first row.....please kindky help me out......thanks in advance....is it necessary to convert button field into template field..
below is my aspx code and image
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" ForeColor="Black" Height="122px" Width="495px" onrowdatabound="GridView1_RowDataBound"> <FooterStyle BackColor="#CCCCCC" /> <RowStyle BackColor="White" /> <Columns> <asp:BoundField HeaderText="Application No" DataField="appno" /> <asp:BoundField HeaderText="Name" DataField="appname" /> <asp:BoundField HeaderText="Company Name" DataField="cname" /> <asp:BoundField HeaderText="Post Name" DataField="pname" /> <asp:BoundField HeaderText="Email" DataField="email" /> <asp:BoundField HeaderText="Mobile No" DataField="mobile" /> <asp:BoundField DataField="mksobtain" HeaderText="Marks Obtain" /> <asp:BoundField DataField="mkstot" HeaderText="Total Marks" /> <asp:BoundField DataField="hrname" HeaderText="HR Name" /> <asp:BoundField DataField="hrno" HeaderText="HR No" /> <asp:TemplateField HeaderText="Qualification Process"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server"></asp:Label> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSource='<%#getvalues()%>' DataTextField="quali" DataValueField="quali"> </asp:DropDownList> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Sending process" ShowHeader="False"> <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="" Text="Send"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> </Columns> <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" /> <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" /> </asp:GridView>narendrajara...
Participant
841 Points
232 Posts
Re: How to get values of gridview on clicking of a button inside gridview
Oct 16, 2012 08:04 AM|LINK
<asp:LinkButton ID="lBtnSend" OnClick="lBtnSend_Click" runat="server" CommandArgument='<%#Eval("Uniq filed name like auto increament field") %>'>Edit</asp:LinkButton>
CommandArgument : you can pass any field value in commangeArgument pass here uniq id from your table.
protected void lBtnSend_Click(object sender, EventArgs e)
{
LinkButton edit = (LinkButton)(sender);
int id=Convert.ToInt32(edit.CommandArgument); //Here you get your Uniq Id which is Passed from CommandArgument of GRid View.
Now here pass the select query
select email,mobile from table where id=id
//Send Email & Send Sms.
}
Thanks & Regards
Narendra
Rounak Rana
Member
48 Points
237 Posts
Re: How to get values of gridview on clicking of a button inside gridview
Oct 16, 2012 08:34 AM|LINK
sir had i had to use link button inside gridview...or outside gridview......and if outside gridview how can i get the values of the row of the row which is clicked..please if u can explain me...
narendrajara...
Participant
841 Points
232 Posts
Re: How to get values of gridview on clicking of a button inside gridview
Oct 16, 2012 01:36 PM|LINK
use it in inside the grid view dear
Thanks & Regards
Narendra
Priya621
Member
8 Points
31 Posts
Re: How to get values of gridview on clicking of a button inside gridview
Dec 26, 2012 12:00 PM|LINK
Thanks !! It helped me..