Hello, I've created a sharepoint web part with rad ajax manager and a grid. the grid has a couple of image buttons which on clicking need to do a full post back (this is to refresh the whole page so that a grid in another webpart gets updated).
I then used the itemCreatedEvent to call the __dopostback function
Im creating the RadAjaxManager1 in CreateChildControls() method and ive added the grid to be ajaxified to the ajaxsettings of the radAjaxManager on OnLoad Event.
I'm getting the following javascript error when trying to click on the print icon.
Error: ctl00_m_g_c8e8aeac_14ee_41bf_ad30_478d4ab3f78b_RadAjaxManager1 is undefined.
Any idea what i'm missing. I would appreciate any help. Thank you.
Phani
| RadGrid oGrid = new RadGrid(); |
| oGrid.ID = "ProjectGrid"; |
| oGrid.Skin = "WebBlue"; |
| //oGrid.Width = new Unit(100, UnitType.Percentage); |
| oGrid.AutoGenerateColumns = false; |
| oGrid.AllowPaging = true; |
| oGrid.AllowSorting = true; |
| oGrid.ClientSettings.Resizing.AllowColumnResize = true; |
| oGrid.ClientSettings.AllowColumnsReorder = true; |
| //oGrid.MasterTableView.allow |
| oGrid.NeedDataSource += new GridNeedDataSourceEventHandler(oGrid_NeedDataSource); |
| oGrid.MasterTableView.Columns.Clear(); |
| GridButtonColumn Print = new GridButtonColumn(); |
| Print.ButtonType = GridButtonColumnType.ImageButton; |
| Print.ImageUrl = @"\_layouts\wpresources\images\print.gif"; |
| Print.UniqueName = "Print"; |
| Print.CommandName = "Print"; |
| Print.ItemStyle.Width = new Unit(10, UnitType.Pixel); |
| oGrid.MasterTableView.Columns.Add(Print); |
| oGrid.ItemCommand += new GridCommandEventHandler(oGrid_ItemCommand); |
| oGrid.ItemCreated += new GridItemEventHandler(oGrid_ItemCreated); |
I then used the itemCreatedEvent to call the __dopostback function
| void oGrid_ItemCreated(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridDataItem) |
| { |
| GridDataItem dataItem = e.Item as GridDataItem; |
| ImageButton imgbtn1 = dataItem["Print"].Controls[0] as ImageButton; |
| ImageButton imgbtn2 = dataItem["CreateNew"].Controls[0] as ImageButton; |
| ImageButton imgbtn3 = dataItem["MakeActive"].Controls[0] as ImageButton; |
| ImageButton imgbtn4 = dataItem["CopyToClipboard"].Controls[0] as ImageButton; |
| imgbtn1.OnClientClick = String.Format(@"{0}.__doPostBack(""{1}"",""{2}"");return false;", ((RadAjaxManager)FindControl("RadAjaxManager1")), imgbtn1.UniqueID, imgbtn1.CommandArgument); |
| } |
| } |
I'm getting the following javascript error when trying to click on the print icon.
Error: ctl00_m_g_c8e8aeac_14ee_41bf_ad30_478d4ab3f78b_RadAjaxManager1 is undefined.
Any idea what i'm missing. I would appreciate any help. Thank you.
Phani