Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
Looking over the template options, I can see a 'entire menu' template, or an 'individual' template options. Is there anyway I can create a few templates that I can then apply to various menu items?
In my menu I want to have some with textboxes, some with calendars, ect.
Instead of having every one with their own template that I'd just start copy and pasting to do, is there a way I could create one and 'assign' it to the menu items?

If there is - Where'd I miss it? :)

If not - Look a feature request. :)
Yana
Telerik team
 answered on 26 Sep 2009
1 answer
44 views
I found this bug and am not sure if it is a RadEditor code bug or a problem with the demo code. This is how to reproduce it.

Go to this page with FireFox (I am using version 3.5.3)

http://demos.telerik.com/aspnet-ajax/editor/examples/customdialogs/defaultcs.aspx

In the editor window select word WYSIWYG and click the first editor button (Insert Special Link). Fill in the dialog and click insert link button. Notice the loss of text before the word WYSIWYG

I need to implement this type of feature and this bug would be a show stopper.
Lini
Telerik team
 answered on 26 Sep 2009
1 answer
136 views
Is it possible to have one?  I simply want a ListBox with lines separating the items in it; but I don't want to make an item template.  I know the RadGrid allows cell borders but haven't seen any examples of a ListBox with them on the website.

Thanks,

Ed Graham
Genady Sergeev
Telerik team
 answered on 26 Sep 2009
1 answer
70 views
Ia m trying to open a window when there is an excetion raised.  Per the documentation you can add a control to the bottom of the grid but this is not user friendly and hardly visible in the example:

I can open the window on the client side and set the public variable but can't actually get that value to the client.

******

So I have the public variable for my class:

Public

 

ERR_DESC As String = ""

 

And set this on the Itemupdate() event:

Protected Sub RadGrid1_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles RadGrid1.ItemUpdated
        If Not e.Exception Is Nothing Then
            e.KeepInEditMode = True
            e.ExceptionHandled = True
            ERR_DESC = e.Exception.Message.ToString
        End If
 End Sub

*****

On the client ERR_DESC has the e.Exception.Message.ToString value when it's binding the server side code to the client-side variable but when the client is written the variable is an empty string.

      Sys.Application.add_load(applicationLoadHandler);

      function applicationLoadHandler() {
        debugger;
     
        var ERR_DESC='<%=ERR_DESC%>';
        if (ERR_DESC!='') {
            var oWnd = radopen("RTS_Message_Window.aspx?message="+ERR_DESC+"&title=Problem Running Report" , "RadWindow1" );
            oWnd.setSize (300, 200);
            oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
          }              
        }


What am I missing here??
Tsvetoslav
Telerik team
 answered on 26 Sep 2009
1 answer
305 views
Hello
I have a WebControl Project ,it has many class that Create Dynamic control ,for example TextBox,checkBox and so on.
in my project Generat WebForm via this project and i have a class name "Grid"
in this class I create a RadGrid and Bind to diffrent Table
I want to Insert/Delete/Update via Grid and UserControl
when I Click "Add new Record" in top Grid:NeedDataSource And ItemCommand Event Raised and Load UserControl
but I Click Save Button with "PerformInsert" CommandName just NeedDataSource And ItemCommand Event Raised and InsertCommand Event not raise
Thanks a lot
 public override System.Web.UI.Control GetControl(System.Data.DataRow dr)  
        {  
            ItemData = dr;  
            Telerik.Web.UI.RadAjaxPanel pnl = new Telerik.Web.UI.RadAjaxPanel();  
            //System.Web.UI.WebControls.Panel pnl = new System.Web.UI.WebControls.Panel();  
            pnl.Width = this.Width;              
            pnl.ID = this.ID;  
            pnl.Visible = this.Visible;  
            pnl.Attributes.Add("Style", string.Format("position: absolute;left: {0}px; Top:{1}px;z-index:{2};", this.Left, this.Top , this.zIndex));  
            pnl.Width = this.Width;  
            pnl.Height = this.Height;  
            Telerik.Web.UI.RadGrid _RadGrid = new Telerik.Web.UI.RadGrid();  
            _RadGrid.Width = this.Width;  
            _RadGrid.Height = this.Height;  
            _RadGrid.Visible = this.Visible;  
            _RadGrid.ClientSettings.Scrolling.AllowScroll = true;  
            _RadGrid.ID = "grd_" + this.ID;  
            //_RadGrid.AllowAutomaticInserts = true;  
            //_RadGrid.AllowAutomaticUpdates = true;  
              
            if (!this.ReadOnly)  
            {  
                _RadGrid.MasterTableView.CommandItemDisplay = Telerik.Web.UI.GridCommandItemDisplay.Top;  
                _RadGrid.MasterTableView.CommandItemSettings.AddNewRecordText = "اضافه کردن رکورد جدید";  
                _RadGrid.MasterTableView.CommandItemSettings.RefreshText = "بروز رسانی";  
                _RadGrid.Attributes.Add("Style", string.Format("position: absolute;left: {0}px; Top:{1}px;", 0, 0));  
                _RadGrid.Height = this.Height;  
                //_RadGrid.MasterTableView.EditMode = Telerik.Web.UI.GridEditMode.InPlace;  
              
            }              
            //_RadGrid.MasterTableView.EditFormSettings.PopUpSettings. ZIndex = 15000;  
            _RadGrid.MasterTableView.EditFormSettings.FormStyle.BackColor = System.Drawing.Color.WhiteSmoke;  
             _RadGrid.Skin = "Office2007";  
            _RadGrid.MasterTableView.EditFormSettings.EditFormType = Telerik.Web.UI.GridEditFormType.WebUserControl;  
            //_RadGrid.ClientSettings.ClientEvents.OnPopUpShowing = "PopUpShowing"; // this function must exist in Master Page ;)  
            _RadGrid.MasterTableView.EditFormSettings.UserControlName = "~/FormGeneratorTools/UCLoadForm.ascx";  
            _RadGrid.MasterTableView.DataKeyNames =new string[1]{string.Format("frm{0}Id", BindingFormID)};  
            _RadGrid.NeedDataSource += new GridNeedDataSourceEventHandler(_RadGrid_NeedDataSource);  
            _RadGrid.ItemCommand += new GridCommandEventHandler(_RadGrid_ItemCommand);  
            _RadGrid.InsertCommand += new GridCommandEventHandler(_RadGrid_InsertCommand);  
            _RadGrid.UpdateCommand += new GridCommandEventHandler(_RadGrid_UpdateCommand);  
            _RadGrid.DeleteCommand += new GridCommandEventHandler(_RadGrid_DeleteCommand);  
            AddcolumntoGrid(_RadGrid);  
            _RadGrid.AutoGenerateColumns = false;  
            object objj = _RadGrid.DataSource;  
            pnl.Controls.Add(_RadGrid);  
            return pnl;  
        }  
 
        void _RadGrid_DeleteCommand(object source, GridCommandEventArgs e)  
        {  
            string ID = (e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex][string.Format("frm{0}Id", BindingFormID)].ToString();  
            if (((RadGrid)source).Page.Session["Data_" + BindingFormID] != null)  
            {  
                System.Data.DataSet ds = (System.Data.DataSet)((RadGrid)source).Page.Session["Data_" + BindingFormID];  
                if (ds.Tables[0].Rows.Find(ID) != null)  
                {  
                    ds.Tables[0].Rows.Find(ID).Delete();  
                    ds.Tables[0].AcceptChanges();  
                }  
            }  
        }  
 
        void _RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
        {  
            System.Data.DataSet ds = new System.Data.DataSet();  
             if (e.RebindReason == GridRebindReason.InitialLoad)  
                 ((RadGrid)source).Page.Session["Data_" + BindingFormID] = GetData();   
 
             if (((RadGrid)source).Page.Session["Data_" + BindingFormID] != null)  
                 ds.Merge((System.Data.DataSet)((RadGrid)source).Page.Session["Data_" + BindingFormID]);  
                   
            if(ds!=null)   
                ((RadGrid)source).DataSource = ds;  
        }          
        void _RadGrid_InsertCommand(object source, GridCommandEventArgs e)  
        {  
             
            GridEditableItem editedItem = e.Item as GridEditableItem;  
            UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);  
            object obj = userControl.FindControl("Co_" + BindingFormID);  
            System.Data.DataSet dsNewData = ((WebForm)obj).GetDate(userControl.Request);  
            string CurrentID = "0";  
            if (userControl.Session["Data_" + BindingFormID] != null)  
            {  
                if((((System.Data.DataSet)userControl.Session["Data_" + BindingFormID])).Tables[0].Rows.Count!=0)  
                    CurrentID = (((System.Data.DataSet)userControl.Session["Data_" + BindingFormID])).Tables[0].Select(string.Format("frm{0}Id > 0", BindingFormID), string.Format("frm{0}Id DESC", BindingFormID))[0][string.Format("frm{0}Id", BindingFormID)].ToString();  
                dsNewData.Tables[0].Rows[0][string.Format("frm{0}Id", BindingFormID)] = long.Parse(CurrentID) + 1;  
                dsNewData.Merge((System.Data.DataSet)userControl.Session["Data_" + BindingFormID]);  
            }  
            else 
                dsNewData.Tables[0].Rows[0][string.Format("frm{0}Id", BindingFormID)] = long.Parse(CurrentID);  
 
            userControl.Session["Data_" + BindingFormID] = dsNewData;  
     
        }  
        /// <summary>  
        ///   
        /// </summary>  
        /// <param name="source"></param>  
        /// <param name="e"></param>  
        void _RadGrid_ItemCommand(object source, GridCommandEventArgs e)  
        {  
            ((Telerik.Web.UI.GridBaseDataList)(source)).Page.Session["FormID"] = BindingFormID;  
        }  
        /// <summary>  
        ///   
        /// </summary>  
        /// <param name="source"></param>  
        /// <param name="e"></param>  
        void _RadGrid_UpdateCommand(object source, GridCommandEventArgs e)  
        {  
 
            GridEditableItem editedItem = e.Item as GridEditableItem;  
            UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);  
            object obj = userControl.FindControl("Co_" + BindingFormID);  
            System.Data.DataSet dsNewData = ((WebForm)obj).GetDate(userControl.Request);  
            string ID = (e.Item as GridEditFormItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex][string.Format("frm{0}Id", BindingFormID)].ToString();  
            if (userControl.Session["Data_" + BindingFormID] != null)  
            {  
                dsNewData.Tables[0].Rows[0][string.Format("frm{0}Id", BindingFormID)] = ID;  
                if(((System.Data.DataSet)userControl.Session["Data_" + BindingFormID]).Tables[0].Rows.Find(ID)!=null)  
                    ((System.Data.DataSet)userControl.Session["Data_" + BindingFormID]).Tables[0].Rows.Find(ID).Delete();  
                ((System.Data.DataSet)userControl.Session["Data_" + BindingFormID]).AcceptChanges();  
                dsNewData.Merge((System.Data.DataSet)userControl.Session["Data_" + BindingFormID]);  
            }  
            userControl.Session["Data_" + BindingFormID] = dsNewData;  
              
        } 
Tsvetoslav
Telerik team
 answered on 26 Sep 2009
1 answer
143 views
hi

I am expriencing an object expected error:

 

function OpenPositionedWindow(oButton, url, windowName) {

 

 

var oWnd = window.radopen(url, windowName);

 

}


function openWin() {

 

var oWnd = radopen("http://www.google.com", "RadWindow1");

oWnd.setSize(500, 500);

oWnd.center();


<

 

button onclick="openWin(); return false;">Test</button>


I am using Q1 2009.

 

Georgi Tunev
Telerik team
 answered on 26 Sep 2009
1 answer
164 views
Hi,

I'm trying to delete a record from the RadGrid.
So i'm handling the ondeletecommand like this:

protected void AppointmentsGrid_DeleteCommand( object source, GridCommandEventArgs e )  
    {  
      DALDataContext dc = new DALDataContext();  
 
      int appointmentID = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["AppointmentID"];  
      dc.Appointments.DeleteOnSubmit(dc.GetAppointmentByID(appointmentID));  
      dc.SubmitChanges();  
 
      AppointmentsGrid.DataBind();  
    } 

The code above works fine, but this is not an easy way to get the appointmentID.
Unfortunately i can't the following code to work:

DALDataContext dc = new DALDataContext();  
 
vw_Appointment appointment = (vw_Appointment)e.Item.DataItem;  
 
dc.Appointments.DeleteOnSubmit(dc.GetAppointmentByID(appointment.AppointmentID));  
dc.SubmitChanges(); 

Because the dataitem seems to be null all the time??
Is there an explanation for this?
Vlad
Telerik team
 answered on 26 Sep 2009
3 answers
160 views
I want to create a nested Grid and would like to be able to apply some formatting for rows in the master table if there are no child records yet created. I assume I need to put code in the ItemCreated event just not sure where to go from there. Any help would be appreciated.
AkAlan
Top achievements
Rank 2
 answered on 25 Sep 2009
7 answers
1.0K+ views
Hi, I have a grid that uses the [Add new record] button in the Command row. I click the button and the insert row appears (in-line) and all works great.

My question is how do I set the grid so that this command row is showing when the grid first loads and always shows?

Thanks
Sameer Alibhai
Top achievements
Rank 1
 answered on 25 Sep 2009
6 answers
679 views
I have a Radgird that has a GridDropDownColumn
<telerik:GridDropDownColumn DataField="SubscriptionID" HeaderText="Subscription"   
                    ListTextField="SubscriptionDescription" ListValueField="SubscriptionTypeID" UniqueName="SubscriptionTypeID"/> 

In code behind I get all the possible values
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem)  
            {  
                if (!_isBound)  
                {  
                      CapitalPortalDataContext db = new CapitalPortalDataContext();  
                      var nSubscriptions = from s in db.Subscriptions.Where(s => (bool)s.Active)  
                                           select new  
                                           {  
                                               s.SubscriptionTypeID,  
                                               s.SubscriptionDescription  
                                           };  
                    
                        (((GridDropDownColumnEditor)  
                        ((GridDropDownColumn)RadGrid1.MasterTableView.GetColumnSafe("SubscriptionTypeID")).ColumnEditor)).DataSource = nSubscriptions;                 
                      
                    _isBound = true;  
                    
                }  
            }  
        } 


What I would like to do is add another item at index 0
like to add a value of 0 and text of "Select Type"

in a normal dropdown you would create the item and add to the dropdown after the databind.  How is this possible in the radgrid?
Eric Klein
Top achievements
Rank 1
 answered on 25 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?