Click here to Skip to main content
15,904,986 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get device state(enable or disable)? Pin
Ben Fair22-Jan-09 4:51
Ben Fair22-Jan-09 4:51 
AnswerRe: How to get device state(enable or disable)? Pin
CooperWu22-Jan-09 14:48
CooperWu22-Jan-09 14:48 
Questiongetting the row index in c# Pin
amitpathak02421-Jan-09 18:11
amitpathak02421-Jan-09 18:11 
AnswerRe: getting the row index in c# Pin
RajpootRohan21-Jan-09 18:34
professionalRajpootRohan21-Jan-09 18:34 
Questiongetting the row index in c# Pin
RajpootRohan21-Jan-09 17:55
professionalRajpootRohan21-Jan-09 17:55 
AnswerRe: getting the row index in c# Pin
ColinM12321-Jan-09 18:11
ColinM12321-Jan-09 18:11 
GeneralRe: getting the row index in c# Pin
RajpootRohan21-Jan-09 18:16
professionalRajpootRohan21-Jan-09 18:16 
AnswerRe: getting the row index in c# Pin
dan!sh 21-Jan-09 19:22
professional dan!sh 21-Jan-09 19:22 
GeneralRe: getting the row index in c# Pin
RajpootRohan21-Jan-09 19:42
professionalRajpootRohan21-Jan-09 19:42 
AnswerRe: getting the row index in c# Pin
lachu00921-Jan-09 22:48
lachu00921-Jan-09 22:48 
Question[Message Deleted] Pin
Nikki0521-Jan-09 17:45
Nikki0521-Jan-09 17:45 
AnswerRe: How to write the web method. Pin
Ashfield21-Jan-09 21:05
Ashfield21-Jan-09 21:05 
QuestionHow to implement kerberos authentication in C# Pin
lachu00921-Jan-09 17:04
lachu00921-Jan-09 17:04 
AnswerRepost Pin
dan!sh 21-Jan-09 19:15
professional dan!sh 21-Jan-09 19:15 
QuestionCreate Stored Proc at Window Start up Pin
CodingYoshi21-Jan-09 16:35
CodingYoshi21-Jan-09 16:35 
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 

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.