I was searching through the old forums trying to figure out how to bind a value to a Templated Column that is using an Web Image Button. For the most part, I saw unanswered posts from a long time ago. I finally found the answer, so I will post it:
This is what the column code looks like for the grid in the aspx page:
<igtbl:TemplatedColumn Key="RecId" BaseColumnName="RecId" AllowRowFiltering="false" Width="25px">
<CellTemplate>
<igtxt:WebImageButton ID="btnLink" runat="server"
CssClass="pointer"
OnCommand="btnLink_Command" CommandArgument="<%# Container.Value%>" ToolTip="Edit Security">
<Appearance>
<Image Url="~/Image/icon/ico_edit.gif" />
</Appearance>
</igtxt:WebImageButton>
</CellTemplate>
</igtbl:TemplatedColumn>
Here is the code behind button command event:
{
}
I do have one other question though, is it possible to send the data for more than one column or the entire row using the code above?
We are having an issue as described in the below KB while using window.open. Microsoft says the issue should be fixed in IE
5.0+. We are using IE6 6.0.2900 SP3 and still having this issue.
http://support.microsoft.com/kb/196383
If we use WebDialogWindow, is there any chance we could get this issue fixed? Any suggestions/experience regaridng this will
be great?
Hello,
window.showModalDialog is IE ony extension not supported in full by most browsers. You can take a look at this forum thread for details:
http://forums.asp.net/p/1088999/1635647.aspx
I personally would recommend using our superb WebDialogWindow component - much prettier and easy to use + works on all browsers. You can find samples for WebDialogWindow in our samples site located here:
http://samples.infragistics.com/2008.2/webfeaturebrowser/default.htm
Protected Sub linkbtn_Command(ByVal sender As Object, ByVal e As CommandEventArgs)
Dim currentRow As UltraGridRow = Nothing
Dim Val As String = e.CommandArgument.ToString()
Dim lbtn As LinkButton = DirectCast(sender, LinkButton)
Dim sPrevCount As String
Dim ci As CellItem = DirectCast(lbtn.Parent, CellItem)
If ci IsNot Nothing Then
Dim r As UltraGridRow = ci.Cell.Row
Dim iRow As Integer = ci.Cell.Row.Index
' this will give you the current row index so if you need the value of the next row or previous row then
Dim iprevrow As Integer = iRow
Dim inextrow As Integer = iRow
sPrevCount = UltraWebGrid.DisplayLayout.Rows(iprevrow).Cells.FromKey("Publication_date").Value.ToString()
sNextCount = UltraWebGrid.DisplayLayout.Rows(inextrow).Cells.FromKey("SampleDataCount").Value.ToString()
Dim sHeight As String = "100"
Dim sWidth As String = "200"
Dim sTitle As String = sPrevCount
sScript = "<script>var rc=new Array(0,0); rc=window.showModalDialog('Report_Search_Detail_Modalpopup.aspx?Title=" + sTitle + "','','height:" + sHeight + " px;width:" + sWidth + " px');" + "" & Chr(10) & ""
'this line of code handle the case where I want to return a value back to parent screen from the modal
'This line of code register the script
Me.ClientScript.RegisterStartupScript(GetType(Page), "showModalDialog", sScript)
Any one have idea for Firefox pop height and width.
Regards
Hi,
in your event method;
in your link button even
make sure you have the following lines of code:
LinkButton lbtn = (LinkButton)sender;
CellItem ci = (CellItem)lbtn.Parent;
if(ci != null){
UltragridRow r = ci.Cell.Row;
int iRow = ci.Cell.Row.Index; // this will give you the current row index so if you need the value of the next row or previous row then
int iprevrow = irow -1;
int inextrow = irow +1;
then in your code if you want to retreieve values from previous or next cell then use the following line of code:
sPrevCount = webgrid.displayLayout.Rows[iprevrow].Cells.FromKey("Count").Value.ToString();
sNextCount = webgrid.displayLayout.Rows[inextrow].Cells.FromKey("Count").Value.ToString();
Hope that helps.
I have bind two column my Ultragrid. The first column is "DATE" and second one is "Count". The Second Column "Count" I Am bind Linked button. I got current row value(second). I need first row values(Previous) when i check the second row.
Please help to me.
Sudhakar Rao. MCSD.Net,MCTS