
I have read thru other forum responses to this question and have used the following code which i found in forum responses.
protected
void RiskIdentificationGrid_ItemDataBound(object source, GridItemEventArgs e) //GridItemEventArgs e)
{
if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
{
GridCommandItem cmditm = (GridCommandItem)e.Item;
LinkButton updateButton = (LinkButton)cmditm.FindControl("UpdateButton");
updateButton.Visible = false;
LinkButton lnkbtn1 = (LinkButton)cmditm.FindControl("InitInsertButton");
lnkbtn1.Visible = false;
Button btn1 = (Button)cmditm.FindControl("AddNewRecordButton");
btn1.Visible = false;
}
}
However, when I try to run, I get the following compile error...............
No overload for 'RiskIdentificationGrid_ItemDataBound' matches
delegate 'System.EventHandler'
I have spent many hours trying to figure out why this is happening. Am I missing something, and how can I resovle this.
I am using VS 2008, RadControls for ASP.NET AJAX 3.5 and C#.
Thanks for your help.
| <P><FONT color=#2b91af size=2>RadGridView</FONT><FONT size=2> rgv = |
| (</FONT><FONT color=#2b91af size=2>RadGridView</FONT><FONT |
| size=2>)childControl;</P> |
| <P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> |
| saveCurrentPageIndex = rgv.CurrentPageIndex;</P> |
| <P></P> |
| <P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT |
| color=#0000ff size=2>int</FONT><FONT size=2> p = 0; p < rgv.PageCount; |
| p++)</P> |
| <P>{</P> |
| <P>rgv.CurrentPageIndex = p;</P> |
| <P>rgv.Rebind();</P> |
| <P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT |
| color=#0000ff size=2>int</FONT><FONT size=2> r = 0; r < rgv.Items.Count; |
| r++)</P> |
| <P>{</P> |
| <P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT |
| color=#0000ff size=2>int</FONT><FONT size=2> c = 0; c < |
| rgv.Items[r].Cells.Count; c++)</P> |
| <P>{</P> |
| <P>controlValues.Append(rgv.ClientID);</P> |
| <P>controlValues.Append(</FONT><FONT color=#a31515 size=2>"_Pg"</FONT><FONT |
| size=2> + p + </FONT><FONT color=#a31515 size=2>"Row"</FONT><FONT size=2> + r + |
| </FONT><FONT color=#a31515 size=2>"Col"</FONT><FONT size=2> + c);</P> |
| <P>controlValues.Append(</FONT><FONT color=#a31515 size=2>":"</FONT><FONT |
| size=2>);</P> |
| <P>controlValues.Append(rgv.Items[r].Cells[c].Text);</P> |
| <P>controlValues.Append(</FONT><FONT color=#a31515 size=2>","</FONT><FONT |
| size=2>);</P> |
| <P>}</P> |
| <P>}</P> |
| <P>}</P> |
| <P>rgv.CurrentPageIndex = saveCurrentPageIndex; </FONT><FONT color=#008000 |
| size=2>//Reset page to saved page index.</P></FONT><FONT size=2> |
| <P>rgv.Rebind();<BR></P></FONT> |
This is just part of the code to cycle through the data cells and create one big string of the control name and associated data. The format is a colon between control name and data. With a comma after each pair of control/data pair. In the case of RadGrid the I added the page, row and col to the control name to identify each cell.
Ok, now the initial creatation of the string runs through this code with with no issues. The grid is sorted in descending order and there is 11 items in the grid with paging on and page size to 10. So I have 10 items in the first page and one in the second page. No problem. The in my cancel button I do another capture and this time the same code is ran but now the page 0 has 10 items and then the page 1 has 10 items (same items). It's like the move to page 2 (index 1) is not moving to the next page.
Why does this work on the initial creatation of the string but not the current creatation of the string. What am I doing wrong???
TIA! JerryM
<radC:RadComboBox ID="cboImages" runat="server" Width="150px" DataSourceID="sdsMediaLibrary" SkinsPath="~/RadControls/ComboBox/Skins">
<itemtemplate>
<div>
<img src='../<%# DataBinder.Eval(Container, "Attributes['ImagePath']") %>' alt="" />
</div>
</itemtemplate>
</radC:RadComboBox>
Dim item As RadComboBoxItem = CType(e.Item, RadComboBoxItem)
Dim row As DataRowView = CType(e.Item.DataItem, DataRowView)
item.Attributes("ImagePath") = row("ThumbUrl")
I checked the ItemDataBound Event and a value is being passed for "ThumbUrl", but when it renders I get:
<div>
<img src='../' alt="" />
</div>
and of course the big red X for the image in the dropdown
I have been pouring over the sample code and mine and I just can't seem to figure out what I am missing.
Thanks
Mike