i have a gridview that i have created without datasource control and that has data from a database table and the gridview also has a link selection in one column. The select link is pointed to ActivityID (maybe it will be a problem?)
<asp:GridView ID="gwActivity" runat="server" CssClass="gwActivity" AutoGenerateColumns="false" OnSelectedIndexChanged="gwActivity_SelectedIndexChanged">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkSelect" Text="Select" runat="server" CommandArgument='<%# Eval("ActivityID") %>' OnClick="lnkSelect_Click">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ActivityID" HeaderText="ActivitID" />
<asp:BoundField DataField="Activity" HeaderText="Activit" />
<asp:BoundField DataField="ActivityRegisteredDate" HeaderText="ActivityRegisteredDate" />
<asp:BoundField DataField="Responsible" HeaderText="Responsible" />
<asp:BoundField DataField="Category" HeaderText="Category" />
<asp:BoundField DataField="Change_Requestor" HeaderText="Change_Requestor" />
<asp:BoundField DataField="Priority" HeaderText="Priority" />
<asp:BoundField DataField="Size" HeaderText="Size" />
<asp:BoundField DataField="Status" HeaderText="Status" />
<asp:BoundField DataField="System" HeaderText="System" />
<asp:BoundField DataField="Comment" HeaderText="Comment" />
</Columns>
</asp:GridView>
I have created a OnClick event.
protected void lnkSelect_Click(object sender, EventArgs e)
{
txtActivity.Text = GridView1.SelectedRow.Cells[2].Text;
ddlChange_Requestor.selectedvalue = GridView1.SelectedRow.Cells[6].selectevvalue;
}
i´m i missing something? should i maybe "FindControl".. Im a bit lost here?
e.g.
Activity textbox (txtActivity) = Test2 (it should say that in textbox)................................................... Change requestor dropdown (ddlChange_Requestor) = ... (find change request value and change dropdownlist)

