Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
199 views
i cannot seem to set the width of the gridmaskededitcolumn in a radgrid when it's in edit mode - it always seems to go to some set size instead of the size I set it to - how do I set the width?

<telerik:GridMaskedColumn DataField="contactcontent" UniqueName="contactcontent" 
                        FooterStyle-Width="90px" HeaderStyle-Width="90px" ItemStyle-Width="90px" Mask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" 
                        HeaderText="Contact" ColumnEditorID="ContactContentGridTextBoxColumnEditor"
                    </telerik:GridMaskedColumn> 
                    <telerik:GridMaskedColumn DataField="contactsecondarycontent" UniqueName="contactsecondarycontent" 
                        FooterStyle-Width="25px" HeaderStyle-Width="25px" ItemStyle-Width="25px" Mask="aaaaa" 
                        HeaderText="Ext." ColumnEditorID="ContactContentGridTextBoxColumnEditor"
                    </telerik:GridMaskedColumn> 
 
<telerik:GridMaskedColumnEditor ID="ContactContentMaskedColumnEditor" runat="server" 
            MaskedTextBox-PromptChar=" " MaskedTextBox-DisplayPromptChar=" " MaskedTextBox-DisplayMask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" 
            MaskedTextBox-Mask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
            <MaskedTextBox runat="server" Width="90px" DisabledStyle-Width="90px" EmptyMessageStyle-Width="90px" 
                EnabledStyle-Width="90px" FocusedStyle-Width="90px" HoveredStyle-Width="90px" 
                InvalidStyle-Width="90px" ReadOnlyStyle-Width="90px" PromptChar=" " DisplayPromptChar=" " 
                DisplayMask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" 
                Mask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" /> 
        </telerik:GridMaskedColumnEditor> 
        <telerik:GridMaskedColumnEditor ID="SecondaryContentMaskedColumnEditor" runat="server" 
            MaskedTextBox-PromptChar=" " MaskedTextBox-DisplayPromptChar=" " MaskedTextBox-DisplayMask="aaaaa" 
            MaskedTextBox-Mask="aaaaa"
            <MaskedTextBox runat="server" Width="25px" DisabledStyle-Width="25px" EmptyMessageStyle-Width="25px" 
                EnabledStyle-Width="25px" FocusedStyle-Width="25px" HoveredStyle-Width="25px" 
                InvalidStyle-Width="25px" ReadOnlyStyle-Width="25px" PromptChar=" " DisplayPromptChar=" " 
                DisplayMask="aaaaa" Mask="aaaaa" /> 
        </telerik:GridMaskedColumnEditor> 




also does anyone know how to get rid of the "_" on the display of the values promptchar does not work - it always shows the underlines even when i put in the " " instead as seen above
Dimo
Telerik team
 answered on 24 Jun 2010
1 answer
104 views

Hi, I want to use LINQ in the creation of heirarchy in radgrid, but to no avail, i can't solve.

Here is my snippet.

-------- .cs code-behind -----

// select from dropdownlist, then click button
protected void cmdView_Click(object sender, EventArgs e)
        {
            if (cmbItem.SelectedItem.Text != string.Empty)
            {               
                this.radExpand.Rebind();
            }
        }

// itemID is being fetched from dropdownlist
 void radExpand_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            DataModelDataContext context = new DataModelDataContext();
            if (cmbItem.SelectedItem.Text != string.Empty)
            {
                Guid teacherID = new Guid(cmbItem.SelectedValue);
                var data = from d in context.inventoryItems where d.itemID== itemIDselect d;
                this.radExpand.DataSource = data;
            }
        }

--------------------- .aspx markup -------------------------
<telerik:RadGrid runat="server" ID="radExpand" AllowPaging="True" GridLines="None" PageSize="30" AutoGenerateColumns="False" ShowFooter="True" ShowGroupPanel="false"
                ShowStatusBar="True" OnNeedDataSource="radExpand_NeedDataSource" onitemcreated="radExpand_ItemCreated">
                <MasterTableView>
                        <Columns>
                        <telerik:GridBoundColumn DataField="itemID" HeaderText="ID" UniqueName="itemID">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="Item Name" UniqueName="itemName">
                            <ItemTemplate>
                                <%# myProject.getItemName(Convert.ToString(DataBinder.Eval(Container.DataItem, "itemID"))).ToUpper() %>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="Status" HeaderText="Status">
                            <ItemTemplate>
                                <%# myProject.getStatus(new Guid(Convert.ToString(DataBinder.Eval(Container.DataItem, "itemID")))) %>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

-----------------------------------------

Thank you.

Rosen
Telerik team
 answered on 24 Jun 2010
6 answers
184 views
The following does not work:

function

 

 

CloseOnReload() {

 

GetRadWindow().Close();

}

 

 

function GetRadWindow() {

 

 

 

var oWindow = null;

 

 

 

if (window.radWindow) oWindow = window.radWindow;

 

 

 

else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;

 

 

 

return oWindow;

 

}



This is called by a CloseOnReload() script registered as a startup script when some action is performed.
Georgi Tunev
Telerik team
 answered on 24 Jun 2010
1 answer
139 views
i tried to use a technique that works fine for GridMaskedColumn and GridNumericColumn but it does not work for GridDropDownColumn to set the focus to a particular row of the grid when it's displayed in edit mode

here's my column

<telerik:GridDropDownColumn DataField="id" DataSourceID="MyObjectDataSource" 
                                    HeaderText="Name" ListTextField="name" ListValueField="id" DataType="System.Guid" 
                                    UniqueName="id"
                                </telerik:GridDropDownColumn> 



and here's my code

Entity insertedRecordToSetFocusTo = null
        protected void MyRadGrid_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
            // focus 
            if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) 
            { 
                GridEditableItem item = (GridEditableItem)e.Item; 
                if (insertedRecordToSetFocusTo != null) 
                { 
                    // check if we are at the row to set focus to 
                    if (item.GetDataKeyValue("id2").ToString() == insertedRecordToSetFocusTo.id2.ToString()) 
                    { 
                        RadComboBox c = (RadComboBox)item["id"].Controls[0]; 
                        c.Focus(); 
                        insertedRecordToSetFocusTo = null
                    } 
                } 
            } 
        } 

Tsvetina
Telerik team
 answered on 24 Jun 2010
1 answer
109 views
hi
i'm using a splitter as a way to edit web pages in a CMS.
in one pane, i have a treeview of the web site. in the other pane, as an example, i might have an external page loaded which allows the user to modify the properties of the web page, such as it's title. when they have modified the properties, i want to refresh the treeview. how can i do this? previously, i was using radwindow and the callback functionality there to tell the host page that something had changed. i'd like to be able to do the same thing now with splitter. 
i.e. i want the externally loaded page in the splitter pane to be able to tell the page which is hosting the splitter that something has changed.
cheers,
rob

Tsvetie
Telerik team
 answered on 24 Jun 2010
1 answer
108 views
We have 2 RadGrid control on same page.
when i perform sorting on column, generates an error as below:
sys.invalidoperationexception: type telerik.web.ui.orientation has already been registered

Please find my code as below where i have used scriptManager and two RadGrid as "radDataGrid" and "radgridDataComponent"

<

 

asp:ScriptManager ID="ScriptManager1" ScriptMode runat="server">

 

 

 

 

 

</asp:ScriptManager>

 

 

 

 

 

<telerik:RadAjaxManager runat="server" ID="RadAjaxManager2" DefaultLoadingPanelID="RadAjaxLoadingPanel1">

 

 

 

 

 

<AjaxSettings>

 

 

 

 

 

<telerik:AjaxSetting AjaxControlID="radDataGrid">

 

 

 

 

 

<UpdatedControls>

 

 

 

 

 

<telerik:AjaxUpdatedControl LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelRenderMode="Block" ControlID="radDataGrid" />

 

 

 

 

 

</UpdatedControls>

 

 

 

 

 

</telerik:AjaxSetting>

 

 

 

 

 

<telerik:AjaxSetting AjaxControlID="radgridDataComponent">

 

 

 

 

 

<UpdatedControls>

 

 

 

 

 

<telerik:AjaxUpdatedControl LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelRenderMode="Block" ControlID="radgridDataComponent" />

 

 

 

 

 

</UpdatedControls>

 

 

 

 

 

</telerik:AjaxSetting>

 

 

 

 

 

</AjaxSettings>

 

 

 

 

 

</telerik:RadAjaxManager>

 

 

 

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" Skin="Default">

 

 

 

 

 

</telerik:RadAjaxLoadingPanel>

 

 

 

 

--------------------------------------------------------------------

Same settings on both grids as given below:

<

 

telerik:RadGrid ID="RadGrid1" Width="100%" runat="server" Skin="MyDefault"EnableEmbeddedSkins="false" ShowStatusBar="true" AllowFilteringByColumn="false" AllowSorting="true" AllowPaging="true" AutoGenerateColumns="false" MasterTableView-HeaderStyle-CssClass="mycssGrid">

 

 

Please advice.

Kuldeep

 

 

 

Pavlina
Telerik team
 answered on 24 Jun 2010
1 answer
153 views
Hello,

I have the following Toolbar. Depending on conditions that are evaluated in the databound event of a formview named "fv_ProjectData", I want to enable/disable some buttons. The problem is, that the buttons aren´t updated. The databound event fires as expected and the visible properties of the toolbar buttons are set correctly. But the buttons are updated only when clicking for example another button. What settings in the Ajax Manager are necessary that the formview updates the buttons.
 
Any ideas ?
Robert

       <telerik:RadToolBar ID="rtb_DataButtons" runat="server"  OnClientButtonClicking="ClientButtonClicking" OnButtonClick="rtbDataButtons_ButtonClick" AutoPostBack="True">  
                        <Items> 
                            <telerik:RadToolBarButton runat="server" Value="New" Text="New" ImageUrl="~/img/AddRecord.gif" CommandName="New">  
                            </telerik:RadToolBarButton> 
                            <telerik:RadToolBarButton runat="server" Value="Save" Text="Save" ImageUrl="~/img/Update.gif" CommandName="Save" > 
                            </telerik:RadToolBarButton> 
                            <telerik:RadToolBarButton runat="server" Value="Edit" Text="Edit" ImageUrl="~/img/Edit.gif" CommandName="Edit">  
                            </telerik:RadToolBarButton> 
                            <telerik:RadToolBarButton runat="server" Value="Cancel" Text="Cancel" ImageUrl="~/img/Cancel.gif" CommandName="Cancel" CausesValidation="False">  
                            </telerik:RadToolBarButton> 
                            <telerik:RadToolBarButton runat="server" Value="Delete" Text="Delete" ImageUrl="~/img/Delete.gif" CommandName="Delete" CausesValidation="False">  
                            </telerik:RadToolBarButton> 
                            <telerik:RadToolBarButton runat="server" Value="Separator_1" IsSeparator="true">  
                            </telerik:RadToolBarButton> 
                            <telerik:RadToolBarButton runat="server" Value="Print" Text="Print" ImageUrl="~/img/Print.gif" CommandName="Print">  
                            </telerik:RadToolBarButton> 
                        </Items> 
                    </telerik:RadToolBar> 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" > 
    <AjaxSettings > 
        <telerik:AjaxSetting AjaxControlID="fv_ProjectData">  
                <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="fv_ProjectData"></telerik:AjaxUpdatedControl> 
                        <telerik:AjaxUpdatedControl ControlID="rtb_DataButtons"></telerik:AjaxUpdatedControl> 
                    </UpdatedControls> 
             </telerik:AjaxSetting>   
    </AjaxSettings> 
</telerik:RadAjaxManager>        
 

    Protected Sub fvProject_Databound(ByVal sender As Object, ByVal e As EventArgs)  
       <.. some code ...> 
 
       SetControls(sender)  
 
    End Sub  
 
  Sub SetControls(ByVal aFormview As FormView)  
        If aFormview Is Nothing Then  
            ToolbarBtn_New.Visible = True 
            ToolbarBtn_Edit.Visible = False 
            ToolbarBtn_Save.Visible = False 
            ToolbarBtn_Cancel.Visible = False 
            ToolbarBtn_Delete.Visible = False 
            ToolbarBtn_Separator1.Visible = False 
            ToolbarBtn_Print.Visible = False 
        Else  
            With aFormview  
        ToolbarBtn_New.Visible = (.CurrentMode = FormViewMode.ReadOnly)  
            ToolbarBtn_Edit.Visible = (.CurrentMode = FormViewMode.ReadOnly)  
        ToolbarBtn_Save.Visible = ((.CurrentMode = FormViewMode.Edit) Or (.CurrentMode = FormViewMode.Insert))  
end with  
end if  
 
 

Rosen
Telerik team
 answered on 24 Jun 2010
1 answer
265 views
Hi,
I'm trying to implement virtual scrolling, and it's working great, except that the currentpageindex doesn't update immediately..  I open the page, and it loads page 0.  Then I scroll down, the loading symbol shows, it displays data - same data as page 0.  If I hit 'refresh', it then loads the correct data.  Or, if I scroll down another page (so now the pager says I'm on page 2) it updates and shows me the page 1 data - it's one page behind.  Did I miss a rebind call?  I'm using NeedDataSource, though, and so I don't need to put that in there, right?

Here's my radgrid tag:

<telerik:RadGrid 
    id="RadGrid1" 
    runat="server" 
    ShowGroupPanel="True" 
    GridLines="None" 
    PageSize="20" 
    AllowPaging="True" 
    AllowCustomPaging="True" 
    AllowSorting="True" 
    GroupingEnabled="True" 
    Height="625px" 
    EnableViewState="True" 
    > 
    <PagerStyle Mode="NumericPages" /> 
    <MasterTableView 
        DataKeyNames="id_col" 
        AllowMultiColumnSorting="True" 
        AutoGenerateColumns="False" 
        CommandItemDisplay="Top" 
        ShowHeadersWhenNoRecords="True" 
        ShowFooter="true" 
        > 
        <CommandItemSettings ShowAddNewRecordButton="False"></CommandItemSettings> 
        <Columns> 
            <telerik:GridBoundColumn Visible="False" DataField="name" HeaderText="Name" UniqueName="name"></telerik:GridBoundColumn> 
            <telerik:GridBoundColumn Visible="False" DataField="classname" HeaderText="Class Name" UniqueName="classname"></telerik:GridBoundColumn> 
            <telerik:GridBoundColumn Visible="False" DataField="identifier" HeaderText="Identifier" UniqueName="identifier"></telerik:GridBoundColumn> 
        </Columns> 
    </MasterTableView> 
    <GroupingSettings ShowUnGroupButton="True"></GroupingSettings> 
    <SortingSettings SortToolTip="name" /> 
    <ClientSettings AllowDragToGroup="true"
            <Scrolling 
                AllowScroll="True" 
                EnableVirtualScrollPaging="True" 
                UseStaticHeaders="True" 
                SaveScrollPosition="True" /> 
    </ClientSettings> 
</telerik:RadGrid> 
 

And my vb NeedDataSource function:
Protected Sub RadGrid1_NeedDataSource(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource 
    Dim sql As String 
    Dim cmd As OracleCommand 
    Dim row_count As Integer = 1 
     
    ' Open connection 
    conn.Open() 
 
    ' Set up sql command 
    sql = "db_search" 
    cmd = New OracleCommand(sql, conn) 
    cmd.CommandType = CommandType.StoredProcedure 
 
    ' Add parameters 
    cmd.Parameters.Add("row_start", OracleDbType.Decimal, RadGrid1.CurrentPageIndex * RadGrid1.PageSize, ParameterDirection.Input) 
    cmd.Parameters.Add("row_end", OracleDbType.Decimal, (RadGrid1.CurrentPageIndex + 1) * RadGrid1.PageSize, ParameterDirection.Input) 
    cmd.Parameters.Add("db_cur", OracleDbType.RefCursor, ParameterDirection.Output) 
     
    ' Get row count (cut out this part for brevity, it does update it though) 
    Me.RadGrid1.VirtualItemCount = row_count 
 
    ' Set as the datasource 
    Dim da As New OracleDataAdapter(cmd) 
    Dim ds As New DataSet() 
    da.Fill(ds) 
    Me.RadGrid1.DataSource = ds 
 
    ' Cleanup 
    da.Dispose() 
    ds.Dispose() 
    conn.Close() 
End Sub 

I looked at this thread but it did not fix my issue, as well as various documentation for paging and virtual scrolling, and haven't found a solution yet.  Thanks in advance for any advice!


Martin
Telerik team
 answered on 24 Jun 2010
1 answer
283 views
Hi,

I have a telerik RadTabStrip inside ajax UpdatePanel in my web page and when i navigate between the tabs, i get this wiered error "Invalid JSON primitive". Below is the stack trace of this error.


Type System.ArgumentException
Source System.Web.Extensions
Method DeserializePrimitiveObject
Message Invalid JSON primitive: .
Trace at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)
at Telerik.Web.UI.RadMultiPage.LoadClientState(String state)
at Telerik.Web.UI.RadMultiPage.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Please kindly help to resolve this issue ASAP since its a production issue now.

Thanks,
Krishna Samaga B.
T. Tsonev
Telerik team
 answered on 24 Jun 2010
3 answers
166 views
hi i am using edit template to edit the grid. In the edit template i used timepicker to select the time with interval of 15 minutes. But i need to restrict the start and end time of that timeview. When i set in design source it will work but when i tried in databound event not working
Akhil Raj
Top achievements
Rank 1
 answered on 24 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?