Datagrid control
-
Hi all In a data grid i have two such columns where it acts as a link to a different page. But problem is since i have two response.redirect statements its executing the first one only. My condition is after redirecting to different page i am populating that page with some details( example if i am clicking on cand id 1 then in the next page detail will of cand whose id is 1) so i am using session varible. The code what wrote is If (......I want the condition.....) Then lbCand_Id = e.Item.FindControl("Label5") Session("CAND_ID") = lbCand_Id.Text Response.Redirect("Update_Feedback.aspx") Else lbCand_Id1 = e.Item.FindControl("Label1") Session("Cand_ID1") = lbCand_Id1.Text Response.Redirect("Summary.aspx") End If Pl tel me in if condition what i have to write like datagrid1.item... something like that.so that i can execute both the conditions. Thanks and Regards
Prakash Mishra(Banglore,India)
-
Hi all In a data grid i have two such columns where it acts as a link to a different page. But problem is since i have two response.redirect statements its executing the first one only. My condition is after redirecting to different page i am populating that page with some details( example if i am clicking on cand id 1 then in the next page detail will of cand whose id is 1) so i am using session varible. The code what wrote is If (......I want the condition.....) Then lbCand_Id = e.Item.FindControl("Label5") Session("CAND_ID") = lbCand_Id.Text Response.Redirect("Update_Feedback.aspx") Else lbCand_Id1 = e.Item.FindControl("Label1") Session("Cand_ID1") = lbCand_Id1.Text Response.Redirect("Summary.aspx") End If Pl tel me in if condition what i have to write like datagrid1.item... something like that.so that i can execute both the conditions. Thanks and Regards
Prakash Mishra(Banglore,India)
Hi in datagrid template column u have the hyper link or outside the grid u have?, If inside the grid u have the hyperlink,then u can access the link using this code: For Each MainGRD As DataGridItem In Me.dgrdmain.Items dim Candid as HyperLink=ctype(maingrd.FindControl("Idofhyperlink"),HyperLink) Next Here candid is the hyperlink now..., U can use ur if condition based on that candid..., Did u got it?,
Regards, Magi
-
Hi in datagrid template column u have the hyper link or outside the grid u have?, If inside the grid u have the hyperlink,then u can access the link using this code: For Each MainGRD As DataGridItem In Me.dgrdmain.Items dim Candid as HyperLink=ctype(maingrd.FindControl("Idofhyperlink"),HyperLink) Next Here candid is the hyperlink now..., U can use ur if condition based on that candid..., Did u got it?,
Regards, Magi
hi magi I already wrote the code its working fine my problem is i want to write a condition (if else)so that i can execute my code, Pl see the code in post. So just tell me the if condition. Like suppose i click on the 1 column of the grid some thing like this( datagrid1.item.....) Regards
Prakash Mishra(Banglore,India)
-
Hi all In a data grid i have two such columns where it acts as a link to a different page. But problem is since i have two response.redirect statements its executing the first one only. My condition is after redirecting to different page i am populating that page with some details( example if i am clicking on cand id 1 then in the next page detail will of cand whose id is 1) so i am using session varible. The code what wrote is If (......I want the condition.....) Then lbCand_Id = e.Item.FindControl("Label5") Session("CAND_ID") = lbCand_Id.Text Response.Redirect("Update_Feedback.aspx") Else lbCand_Id1 = e.Item.FindControl("Label1") Session("Cand_ID1") = lbCand_Id1.Text Response.Redirect("Summary.aspx") End If Pl tel me in if condition what i have to write like datagrid1.item... something like that.so that i can execute both the conditions. Thanks and Regards
Prakash Mishra(Banglore,India)
. why didnt u can use query string for passing candid? In datagrid , create a template column with hyper link like
<
`<%#DataBinder.Eval(Container.DataItem, "NewsHeading")%>` >
in c#
protected string GetURL (string fldval ) { //here u can make ur if condition string SzOpenwindow=""; SzOpenwindow="javascript:openMywindow('yourpage1.aspx?&id="+ fldval +"','View',500,320)"; return SzOpenwindow; }
writa js function openMywindow(url,name,iWidth,iHeight) { var iLeft = (screen.availWidth-500 - iWidth/ 2); var iTop = (screen.availHeight-420 - iHeight / 2); var features; var objwindow; features = "width="+iWidth+",height="+iHeight+",left="+iLeft+",top="+iTop; features += ",screenX="+iLeft+",screenY="+iTop; features += ",scrollbars=1,resizable=0,location=0"; features += ",menubar=0,toolbar=0,status=0"; objwindow = window.open(url,name, features); }All I ever wanted is what others have....
CrazySanker -
hi magi I already wrote the code its working fine my problem is i want to write a condition (if else)so that i can execute my code, Pl see the code in post. So just tell me the if condition. Like suppose i click on the 1 column of the grid some thing like this( datagrid1.item.....) Regards
Prakash Mishra(Banglore,India)
Hi i think this is ur probs..., In datagrid ur displaying the candidate id and his photo..., Based on the candi id selection it want to open another child window and show his details ?, If its yes..., Use this way,. In ur datagrid property bulder select the hyperlink column and there u can see "Url format string", There give some other aspx page form and ur passing parameter..., Means it should eb like this: frmCashflowStatementLink.aspx?candid={0} Then there itself see the "target" dropdown box there u select "-new" Then Go to that child page(for me i have taken this one frmCashflowStatementLink.aspx) In ur pageload not postback method give this code: txtLinkID.Text = Request.QueryString("candid") Then in ur sqladapater query u check with that txtlinkid value..., If its correct display those values like..., This only u asked na?,
Regards, Magi
-
Hi all In a data grid i have two such columns where it acts as a link to a different page. But problem is since i have two response.redirect statements its executing the first one only. My condition is after redirecting to different page i am populating that page with some details( example if i am clicking on cand id 1 then in the next page detail will of cand whose id is 1) so i am using session varible. The code what wrote is If (......I want the condition.....) Then lbCand_Id = e.Item.FindControl("Label5") Session("CAND_ID") = lbCand_Id.Text Response.Redirect("Update_Feedback.aspx") Else lbCand_Id1 = e.Item.FindControl("Label1") Session("Cand_ID1") = lbCand_Id1.Text Response.Redirect("Summary.aspx") End If Pl tel me in if condition what i have to write like datagrid1.item... something like that.so that i can execute both the conditions. Thanks and Regards
Prakash Mishra(Banglore,India)
Give command name property to both link. Like as for link1 CommandName="Link1" and link2 CommandnName="Link2" Now U can use If condition on GridView rowcommand event If(commandName=="Link1") { //code is here for link1 } else if(commandName=="Link2") { //code is here for link2 } Best Regard Pathan
---------------------------------------------------
-
Hi i think this is ur probs..., In datagrid ur displaying the candidate id and his photo..., Based on the candi id selection it want to open another child window and show his details ?, If its yes..., Use this way,. In ur datagrid property bulder select the hyperlink column and there u can see "Url format string", There give some other aspx page form and ur passing parameter..., Means it should eb like this: frmCashflowStatementLink.aspx?candid={0} Then there itself see the "target" dropdown box there u select "-new" Then Go to that child page(for me i have taken this one frmCashflowStatementLink.aspx) In ur pageload not postback method give this code: txtLinkID.Text = Request.QueryString("candid") Then in ur sqladapater query u check with that txtlinkid value..., If its correct display those values like..., This only u asked na?,
Regards, Magi
Hi magi i just asked the IF condition in vb for the data grid eg if( first column is selected) do some thing else do some thing I want to know in the bracket what i have to write, any r u form bangalore? Regards
Prakash Mishra(Banglore,India)