Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
70 views
Hello,

I've got a grid with a custom EditForm in place for inserting records (update and delete are not allowed).  Rather than requiring the user to press the Add New Row button, I'd prefer to just have the edit form displaying by default when the screen loads.  They should be able to type in the form, commit it, and it will refresh itself with the new data and once again show another new item form.

I assumed there would be a C# command that I could call in Page_Load that would show this form but I was not able to find it.  I would highly prefer to do this in C# rather than calling the client-side API with Javascript.

I did begin to create a separate form outside of the grid, but because of my layout it really makes more sense for the insert form to be inside the grid control itself.

Thanks in advance to anyone who can tell me how to do this!

Chris
Chris McGrath
Top achievements
Rank 1
 answered on 31 Jan 2011
1 answer
64 views
I am trying to look for an example in VB on how to create a Self-referencing hierarchy grid dynamicaly.  I have created one where i declare all the columns and parameters.  However I want to create it entirly dynamicaly.  I am already creating a standard grid in this manner, however I wish to add this option into the user control created.

I included some code, however would like to see an example if possible. 
' the nestedDatasource is a dataset with a relation added  
 
 
  If NestedTable Then
            RadGrid1.EnableLinqExpressions = False
            RadGrid1.ClientSettings.AllowExpandCollapse = True
            RadGrid1.MasterTableView.HierarchyDefaultExpanded = False
            RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerBind
            RadGrid1.MasterTableView.SelfHierarchySettings.KeyName = NestedTableKey
            RadGrid1.MasterTableView.SelfHierarchySettings.ParentKeyName = NestedTableParentKey
            ' RadGrid1.MasterTableView.SelfHierarchySettings.MaximumDepth = 0
 
            Dim expandCollapseColumn As New GridExpandColumn
            expandCollapseColumn.HeaderStyle.Width = 20
            RadGrid1.MasterTableView.Columns.Add(expandCollapseColumn)
 
 
            RadGrid1.MasterTableView.ShowHeader = False
            RadGrid1.MasterTableView.HierarchyDefaultExpanded = False
 
 
            Datasource = NestedDatasource.Tables(0)
        End If
 
....
 
'create the columns dynamicaly from the dataset
                            boundColumn = New GridBoundColumn
                            RadGrid1.MasterTableView.Columns.Add(boundColumn)
                            boundColumn.DataField = column.ColumnName
                            boundColumn.HeaderText = column.ColumnName.Replace("_", " ").ToLower()
                        If colDataType = "int32" Then
                            boundColumn.DataFormatString = "<nobr>{0:N0}</nobr>"
                            boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center
                        .....
.....
 
 
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
 
        If NestedTable Then
            RadGrid1.MasterTableView.VirtualItemCount = NestedDatasource.Tables(0).Rows.Count()
            RadGrid1.DataSource = NestedDatasource
            RadGrid1.Visible = True
        Else
            If Not Datasource Is Nothing Then
                RadGrid1.MasterTableView.VirtualItemCount = Datasource.Rows.Count()
                RadGrid1.DataSource = Datasource
                RadGrid1.Visible = True
            Else
                RadGrid1.Visible = False
                Exit Sub
            End If
        End If
    End Sub
Just a snippet, the issue I have with this is that when I click on the arrow, nothing expands.  Not sure where I am going wrong here.  Like I said I can get it working when not creating it dynamicaly.  Also like to add, I am plugging this into a usercontrol that already creates a normal grid dynamicaly. 

Just wondering If I need to do something extra?
Daniel
Telerik team
 answered on 31 Jan 2011
3 answers
234 views
Hi,

            Am using RadGrid in my page,having skin for that grid.Skin having client events like RowSelecting,deselcting,RowSelected and Deselected events. Now i want ask the user a java script confirm when ever a user Un check the check box,So i overrided that RowDeselecting event alone in my page.

But the issue is 

    1) whenever i click on that row it is deselecting the records even am preventing RowClick event,i declared RowClick event in skin.
    2) After deselecting the row ,again when i select the row now also it firing RowDeselcting Event.

This issue arises only after overriding the RowDeselecting event.

Please help me to fix this or Suggest me some other solution.

Thanks and regards,
John
Iana Tsolova
Telerik team
 answered on 31 Jan 2011
2 answers
189 views
Exist a Callback to OnAjaxRequest ?

I'm using the ClientEvents-OnResponseEnd="responseEnd".

function

 

 

responseEnd(sender, eventArgs) {
    alert(
'Response complete');
}

This execute when the request END, that's OK, But how i get the return if i want to return some STRING ?

 

Maria Ilieva
Telerik team
 answered on 31 Jan 2011
1 answer
127 views
I am using NodeTemplates in my RadTreeView and have set EnableDragAndDrop and EnableDragAndDropBetweenNodes to true, however, the lines used to indicate the dropzone between two nodes is not showing up.

Any tips or insight on on how I should go about debugging that?

Thanks,
Neil
Kate
Telerik team
 answered on 31 Jan 2011
4 answers
130 views
Hello,

I have own composite control inherited from RadWebControl. It contains RadTextBox control where I need handle keyup client event.
I have implemented client class for it and I attached event in initialize function. In dispose function I'm removing this event handler but it causes javascript error:

Line: 6
Error: '_events' is null or not an object

Here is the script:

nData.KnowledgeManagement.Web.UI.Searcher.prototype =
{
    initialize: function () {
        nData.KnowledgeManagement.Web.UI.Searcher.callBaseMethod(this, 'initialize');
  
        // SearchTextBox
        this._searchTextBox = $find(this.get_id() + '_searchTextBox');
        this._keyUpDelegate = Function.createDelegate(this, this._keyUp);
        $addHandler(this._searchTextBox._textBoxElement, "keyup", this._keyUpDelegate);
  
        // XmlHttpPanel
        this._xmlHttpPanel = $find(this.get_id() + '_xmlHttpPanel');
        this._xmlHttpPanel._searcher = this;
        this._xmlHttpPanel.add_responseEnding(this._xmlHttpPanelResponseEnding);
        this._xmlHttpPanel.add_responseError(this._clientResponseError);
    },
  
    dispose: function () {
        nData.KnowledgeManagement.Web.UI.Searcher.callBaseMethod(this, 'dispose');
  
        if (this._keyUpDelegate) {
            $removeHandler(this._searchTextBox._textBoxElement, "keyup", this._keyUpDelegate);
            this._keyUpDelegate = null;
        }
  
        this._xmlHttpPanel.remove_responseEnding(this._xmlHttpPanelResponseEnding);
        this._xmlHttpPanel.remove_responseError(this._clientResponseError);
    },
  
    _keyUp: function () {
        this._search(this._searchTextBox._textBoxElement.value);
    },
    ...
}

Cound you tell me what I have wrong?
Thanks
Jiri
Maria Ilieva
Telerik team
 answered on 31 Jan 2011
1 answer
73 views
How do I get the DataItem in a NodeDrop event?

I am trying to get my database Id of the row for the source and destination nodes when I drag and drop a node using:

DataRowView dataSourceRow = (DataRowView)e.SourceDragNode.DataItem;

When I step through my code dataSourceRow  is null

Thanks, 
Neil

Dimitar Terziev
Telerik team
 answered on 31 Jan 2011
2 answers
221 views
Hi in my application i have a treeview control ...
In the pageload i have initialized to collapse all the nodes
The problem is when all the nodes get expanded i am unable to accomodate the list on the page  and it gets scrolled...
I need to keep the active selected node displayed with all the other parent nodes collapsed  and if i select the other node the previous active node should get collapsed, so that only one node will be active and the rest will be in collapsed state. I hope you got my scenario and will provide a solution for it.

deva
Top achievements
Rank 1
 answered on 31 Jan 2011
3 answers
75 views

We have a problem with the telerik radeditor on WSS v3. We are using the lite editor: 4.5.6

When clicking bold, italic, underline, justify, indent etc. tool buttons in the middle or at the end of some text the cursor jumps to the start of the text(box). When you select some text first the buttons work fine. Also when inserting a table somewhere in the middle of a text it always inserts the table at the start of the text.
Shortcuts like CTRL+B work fine when typing. 
Toolbuttons like Imagemanager or bullets and numbering work fine as well.

Any help would be much appreciated!

Stanimir
Telerik team
 answered on 31 Jan 2011
3 answers
93 views
Hi

I am adding tabs to a radtabstrip dynamically and the tabs automatically break over multiple rows when they exceed the width of the tabstrip, which is nice. However when I select a tab in the top row it doesn't reorder - which is not so nice. Similar to this question. I have ReorderTabsOnSelect = true, is there something else I have to set?

Markup:
<telerik:RadTabStrip ID="RadTabStrip1" runat="server"
     MultiPageID="RadMultiPage1"
     SelectedIndex="0"
     Skin="Vista"
     ReorderTabsOnSelect="true"
     Width="550px">
</telerik:RadTabStrip>
 
<telerik:RadMultiPage ID="RadMultiPage1" runat="server"
     SelectedIndex="0"
     BorderStyle="Solid" BorderColor="Gray" BorderWidth="1px"
     OnPageViewCreated="RadMultiPage1_PageViewCreated">
</telerik:RadMultiPage>


Source Code:
protected void Page_Load(object sender, EventArgs e)
{
    if (Page.IsPostBack == false)
    {
        //get details of tabs
        List<DummyObject> lstDummys = GetTabsFromDataBase(Request.QueryString["Tabs"]);
        //loop through and add to page
        foreach (DummyObject obj in lstDummys)
        {
           //add tab
           RadTabStrip1.Tabs.Add(new Telerik.Web.UI.RadTab(obj._displayName));
           //add pageview
           RadPageView pageView = new RadPageView();
           pageView.ID = obj._name;
           RadMultiPage1.PageViews.Add(pageView);
        }
    }
}
Dimitar Terziev
Telerik team
 answered on 31 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?