Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
AnswerRe: Create Stored Proc at Window Start up Pin
ColinM12321-Jan-09 16:49
ColinM12321-Jan-09 16:49 
AnswerRe: Create Stored Proc at Window Start up Pin
PIEBALDconsult21-Jan-09 17:37
mvePIEBALDconsult21-Jan-09 17:37 
GeneralRe: Create Stored Proc at Window Start up Pin
Ashfield21-Jan-09 21:07
Ashfield21-Jan-09 21:07 
GeneralRe: Create Stored Proc at Window Start up Pin
CodingYoshi22-Jan-09 3:37
CodingYoshi22-Jan-09 3:37 
QuestionWM_CAP_CONNECT opens Dialog when device is in use Pin
Ze_rman21-Jan-09 15:21
Ze_rman21-Jan-09 15:21 
AnswerRe: WM_CAP_CONNECT opens Dialog when device is in use Pin
_Maxxx_21-Jan-09 16:07
professional_Maxxx_21-Jan-09 16:07 
GeneralRe: WM_CAP_CONNECT opens Dialog when device is in use Pin
Ze_rman22-Jan-09 3:58
Ze_rman22-Jan-09 3:58 
QuestionGetting Selected Index + Datakeys Pin
CrimeanTurtle200821-Jan-09 14:08
CrimeanTurtle200821-Jan-09 14:08 
Hi All,

I am having problems trying to get the selected index and subsequently the datakey value within a gridview , when a button is selected for a particular row.

Ive used the following event handler to fire the action yet the index is -1 regardless of which row is selected and the datakey value is null.

Some help on this would be great. Thanks.

heres my code

<br />
<br />
//source<br />
                    <asp:sqldatasource id="SqlDataSource1" runat="server" xmlns:asp="#unknown"><br />
                        ConnectionString="<%$ ConnectionStrings:NORTHWNDConnectionString %>" <br />
                        SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [ContactTitle] FROM [Customers]"><br />
                    </asp:sqldatasource><br />
                    <asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown"><br />
                        DataKeyNames="CustomerID" DataSourceID="SqlDataSource1" <br />
                        Width="453px" onselectedindexchanged="GridView1_SelectedIndexChanged"><br />
                        <columns><br />
                            <asp:commandfield showselectbutton="True" /><br />
                            <asp:boundfield datafield="CustomerID" headertext="CustomerID" readonly="True"><br />
                                SortExpression="CustomerID" /><br />
                            <asp:boundfield datafield="CompanyName" headertext="CompanyName"><br />
                                SortExpression="CompanyName" /><br />
                            <asp:boundfield datafield="ContactName" headertext="ContactName"><br />
                                SortExpression="ContactName" /><br />
                            <asp:boundfield datafield="ContactTitle" headertext="ContactTitle"><br />
                                SortExpression="ContactTitle" /><br />
                        </asp:boundfield></asp:boundfield></asp:boundfield></asp:boundfield></columns><br />
                    </asp:gridview><br />
<br />
//event handler<br />
<br />
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)<br />
    {<br />
        int i = GridView1.SelectedIndex;<br />
        string datakeyval = GridView1.SelectedDataKey[i].ToString();<br />
    }<br />

QuestionPinging a port Pin
Silvyster21-Jan-09 14:03
Silvyster21-Jan-09 14:03 
AnswerRe: Pinging a port Pin
Dave Kreskowiak21-Jan-09 15:02
mveDave Kreskowiak21-Jan-09 15:02 
QuestionBeginner in Datagridview Pin
Priya Prk21-Jan-09 11:01
Priya Prk21-Jan-09 11:01 
AnswerRe: Beginner in Datagridview Pin
Not Active21-Jan-09 11:05
mentorNot Active21-Jan-09 11:05 
GeneralRe: Beginner in Datagridview [modified] Pin
Priya Prk21-Jan-09 13:14
Priya Prk21-Jan-09 13:14 
GeneralRe: Beginner in Datagridview Pin
Not Active21-Jan-09 13:31
mentorNot Active21-Jan-09 13:31 
GeneralRe: Beginner in Datagridview Pin
Priya Prk21-Jan-09 13:54
Priya Prk21-Jan-09 13:54 
GeneralRe: Beginner in Datagridview Pin
Not Active21-Jan-09 14:00
mentorNot Active21-Jan-09 14:00 
Questiongetting rid of the schema info from Xml Serialization Pin
manustone21-Jan-09 10:33
manustone21-Jan-09 10:33 
AnswerRe: getting rid of the schema info from Xml Serialization Pin
Not Active21-Jan-09 10:39
mentorNot Active21-Jan-09 10:39 
GeneralRe: getting rid of the schema info from Xml Serialization Pin
manustone21-Jan-09 10:55
manustone21-Jan-09 10:55 
QuestionReceive Windows message in Service Pin
pratap198021-Jan-09 9:21
pratap198021-Jan-09 9:21 
AnswerRe: Receive Windows message in Service Pin
Jon Rista21-Jan-09 10:11
Jon Rista21-Jan-09 10:11 
QuestionChild and Parent object graphs Pin
CodingYoshi21-Jan-09 8:48
CodingYoshi21-Jan-09 8:48 
AnswerRe: Child and Parent object graphs Pin
DaveyM6921-Jan-09 9:20
professionalDaveyM6921-Jan-09 9:20 
QuestionBug: Forms are not painting after windows lock Pin
DD_Messi21-Jan-09 8:41
DD_Messi21-Jan-09 8:41 
AnswerRe: Bug: Forms are not painting after windows lock Pin
Ennis Ray Lynch, Jr.21-Jan-09 9:30
Ennis Ray Lynch, Jr.21-Jan-09 9:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.