Click here to Skip to main content
16,006,013 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Log Out issue Pin
dotnetmember10-May-09 21:28
dotnetmember10-May-09 21:28 
GeneralRe: Log Out issue Pin
nitin_ion10-May-09 21:53
nitin_ion10-May-09 21:53 
AnswerRe: Log Out issue Pin
Abhishek Sur10-May-09 22:43
professionalAbhishek Sur10-May-09 22:43 
AnswerRe: Log Out issue Pin
specialdreamsin11-May-09 20:04
specialdreamsin11-May-09 20:04 
QuestionMasterPage Link Problem Pin
Yaazi10-May-09 20:50
Yaazi10-May-09 20:50 
Questionquerystring Pin
Anjani Poornima10-May-09 20:22
Anjani Poornima10-May-09 20:22 
AnswerRe: querystring Pin
saravanan0510-May-09 23:18
saravanan0510-May-09 23:18 
QuestionSpecified cast is not valid Pin
saravanan0510-May-09 18:33
saravanan0510-May-09 18:33 
hi Code behind:


Dim dgitem As DataGridItem
For Each dgitem In Dgdisplay.Items
If cacheRankingName = "cumulativeranking" Then
'If dgitem.ItemType.Item = ListItemType.Header Or dgitem.ItemType.Item = ListItemType.AlternatingItem Or dgitem.ItemType.Item = ListItemType.Item Then
Dim dt As New DataTable
qrytoExecute = "select playerid, firstname , lastname, scores.points as leaderboarddisplay from scores " & qrytoAdd
qrytoExecute &= "group by scores.playerid order by leaderboarddisplay desc, playerid limit 30 "
dt = DBManager.GetDataTable(qrytoExecute)
For i = 0 To dt.Rows.Count - 1
Dim id As String = dt.Rows(i)("playerid").ToString()
Dim Query As String = "select concat(p.firstname,p.lastname) as Name from player p join scores s on s.playerid=p.userid where s.playerid=" & id
Dim retVal = DBManager.GetScalar1(Query)
Dim lbl As Label
Dim intCounter As New Integer

Dim str As String = DirectCast(dgitem.Cells(0).Controls(0), Label).Text



'If txtHNGet.Text = retVal Then


' 'flag = True
' dgitem.Cells(1).BackColor = System.Drawing.Color.DarkRed
'End If
Next
End If
'End If
Exit For
Next
End If

Html:
<asp:datagrid id="Dgdisplay" EnableViewState="False" Runat="server" PageSize="50" GridLines="None"
AutoGenerateColumns="False" Width="65%" AllowPaging="True">
<Columns>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Rank">
<ItemTemplate>
<asp:Label ID="lblrank" Runat="server">
<%#getRank%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Playername">
<ItemTemplate>
<a href='DisplayPlayerBioData.aspx?ids=<%#Container.DataItem("playerid")%>'>
<%#getPlayerName(Container.DataItem("firstname"),Container.DataItem("lastname"))%>
</a>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Count#">
<ItemTemplate>
<asp:Label ID="lblcount" Runat="server">
<%#DataBinder.Eval(Container.DataItem,"leaderboarddisplay")%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn Visible="False">
<ItemTemplate>
<asp:Label ID="lbl1" Runat="server">
<%#getPlayerName(Container.DataItem("firstname"),Container.DataItem("lastname"))%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle Mode="NumericPages" ForeColor="#003300" PageButtonCount="2" HorizontalAlign="Right"
VerticalAlign="Top" Font-Bold="True"></PagerStyle>
</asp:datagrid>

i need to get datagrid cell value in codebehind..
here
Dim str As String = DirectCast(dgitem.Cells(0).Controls(0), Label).Text
//error displayed Specified cast is not valid.

Datagrid contain in webusercontrol
how can i get cell value...

Known Is Drop.Unknown Is Ocean

AnswerRe: Specified cast is not valid Pin
dotnetmember10-May-09 19:02
dotnetmember10-May-09 19:02 
QuestionHow to Impersonate local system account in c# Pin
Cafedreamz10-May-09 15:36
Cafedreamz10-May-09 15:36 
AnswerRe: How to Impersonate local system account in c# Pin
N a v a n e e t h10-May-09 16:23
N a v a n e e t h10-May-09 16:23 
QuestionHow to place a calendar control in a dropdown list??? Pin
harissssss10-May-09 10:13
harissssss10-May-09 10:13 
AnswerRe: How to place a calendar control in a dropdown list??? Pin
Abhishek Sur10-May-09 10:31
professionalAbhishek Sur10-May-09 10:31 
AnswerRe: How to place a calendar control in a dropdown list??? Pin
AlexeiXX310-May-09 18:14
AlexeiXX310-May-09 18:14 
QuestionHow To Fetch Client IP Address Continuesly After Every Specific Second And To Redirec Client URL Pin
maxuser1310-May-09 9:20
maxuser1310-May-09 9:20 
AnswerRe: How To Fetch Client IP Address Continuesly After Every Specific Second And To Redirec Client URL Pin
Abhishek Sur10-May-09 9:59
professionalAbhishek Sur10-May-09 9:59 
QuestionUnExpected Errors on webserve Pin
Aman Bhullar10-May-09 5:52
Aman Bhullar10-May-09 5:52 
AnswerRe: UnExpected Errors on webserve Pin
Herman<T>.Instance13-May-09 3:47
Herman<T>.Instance13-May-09 3:47 
QuestionCrystal Reports not working on Web Server Pin
yogesh_kumar_agarwal10-May-09 3:38
yogesh_kumar_agarwal10-May-09 3:38 
AnswerRe: Crystal Reports not working on Web Server Pin
N a v a n e e t h10-May-09 4:40
N a v a n e e t h10-May-09 4:40 
GeneralRe: Crystal Reports not working on Web Server Pin
yogesh_kumar_agarwal10-May-09 5:02
yogesh_kumar_agarwal10-May-09 5:02 
GeneralRe: Crystal Reports not working on Web Server Pin
Ramesh Swaminathan10-May-09 5:15
Ramesh Swaminathan10-May-09 5:15 
GeneralRe: Crystal Reports not working on Web Server Pin
yogesh_kumar_agarwal10-May-09 5:27
yogesh_kumar_agarwal10-May-09 5:27 
GeneralRe: Crystal Reports not working on Web Server Pin
N a v a n e e t h10-May-09 7:27
N a v a n e e t h10-May-09 7:27 
GeneralRe: Crystal Reports not working on Web Server Pin
yogesh_kumar_agarwal10-May-09 7:43
yogesh_kumar_agarwal10-May-09 7:43 

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.