
protected void AD_View_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "ExpandCollapse")
{
GridDataItem item = (GridDataItem)e.Item;
item.Selected =
true;
string strkey = item.GetDataKeyValue("AD_ID").ToString();
this.Title = this.Title + strkey + " Mode(Expand): " + ((item.Expanded) ? false : true) ;
Label lbl = (Label)item.FindControl("lblRowNumber");
//EDR_View this is nested grid
RadGrid grdEDR_View = (RadGrid)item.FindControl("EDR_View");
if (grdEDR_View != null)
{
grdEDR_View.DataSource = GET_EDR_Records(strkey);
}
}
}
RadGrid1.MasterTableView.HierarchyDefaultExpanded =
true;
foreach (GridTableView gtv in RadGrid1.MasterTableView.DetailTables)
gtv.HierarchyDefaultExpanded =
true;
Just wonder how to expand all sub-grids at one time by default.
Thanks in advance,
Richard
Hi,
I posted several threads in various Telerik AJAX forums and have not had replies to all. I will try posting here since I'm using the courseware and encountering problems doing the lessons.
| Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) |
| 'Check for GridHeaderItem if you wish tooltips only for the header cells |
| If TypeOf e.Item Is GridHeaderItem Then |
| Dim headerItem As GridHeaderItem = TryCast(e.Item, GridHeaderItem) |
| headerItem("CreditRating").ToolTip = "CreditRating" |
| headerItem("PreferredVendorStatus").ToolTip = "PreferredVendorStatus" |
| headerItem("ActiveFlag").ToolTip = "ActiveFlag" |
| End If |
| End Sub |
| Protected Sub RadGrid1_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) |
| Dim item As GridDataItem = TryCast(e.DraggedItems(0), GridDataItem) |
| RadAjaxManager1.Alert("Dropped VendorID: " + item.GetDataKeyValue("VendorID")) |
| End Sub |
| [T-SQL] |
| DELETE FROM Purchasing.[Vendor] WHERE [VendorID] = @VendorID |
| Line: 7 |
| Char: 62099 |
| Error: Sys.WebForms.PageReuestManagerServerErrorException: The transaction ended in the trigger. The batch has been aborted. Vendors cannot be deleted. They can only be marked as not active |
| Protected Sub RadGrid1_ItemInserted(ByVal source As Object, ByVal e As GridInsertedEventArgs) |
| If e.Exception <> Nothing Then |
| e.ExceptionHandled = True |
| e.KeepInInsertMode = True |
| DisplayMessage("Product cannot be inserted. Reason: " + e.Exception.Message) |
| Else |
| DisplayMessage("Product inserted") |
| End If |
| End Sub |
The compilation error I get using the code in #4 is:
Compiler Error Message: BC30452: Operator '<>' is not defined for types 'System.Exception' and 'System.Exception'.
Also, within the code, there are squiggly lines under "DisplayMessage". The caption is "Name 'DisplayMessage' is not declared". I understand how to declare a variable, but what should I declare it as?
Thanks very much for all help,
r2
| <p> |
| <object height="360" width="480" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> |
| <param name="flashvars" value="/Files/movie.flv"> |
| <param name="movie" value="/Files/videoPlayer.swf"> |
| <embed src="/Files/videoPlayer.swf" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="file=/Files/Movie.flv" width="480" height="360"> |
| </object> |
| </p> |