Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
71 views
this is my markup:
01.<telerik:RadGrid ID="rgCustomerContacts" runat="server" AllowPaging="True"
02.                        AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="true">
03.                        <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="ContactID" EditMode="PopUp">
04.                            <EditFormSettings>
05.                                <PopUpSettings Width="800px" Modal="true" />
06.                            </EditFormSettings>
07.                            <Columns>
08.                                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" >
09.                                </telerik:GridEditCommandColumn>
10.                                <telerik:GridBoundColumn UniqueName="FullContactName" HeaderText="Contact Name" DataField="FullContactName">
11.                                </telerik:GridBoundColumn>
12.                                <telerik:GridBoundColumn UniqueName="Email" HeaderText="Email" DataField="Email">
13.                                </telerik:GridBoundColumn>
14.                                <telerik:GridBoundColumn UniqueName="Phone" HeaderText="Phone" DataField="Phone">
15.                                </telerik:GridBoundColumn>
16.                                <telerik:GridBoundColumn UniqueName="Fax" HeaderText="Fax" DataField="Fax">
17.                                </telerik:GridBoundColumn>
18.                                <telerik:GridBoundColumn UniqueName="Title" HeaderText="Title" DataField="Title">
19.                                </telerik:GridBoundColumn>
20.                                <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete">
21.                                </telerik:GridButtonColumn>
22.                            </Columns>
23.                            <EditFormSettings UserControlName="~/WebControls/ContactUserControl.ascx" EditFormType="WebUserControl">
24.                                <EditColumn UniqueName="EditCommandColumn1">
25.                                </EditColumn>
26.                            </EditFormSettings>
27.                        </MasterTableView>
28.                        <%--<ClientSettings>
29.                            <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
30.                        </ClientSettings>--%>
31.                    </telerik:RadGrid>
 and here is my code behind:
01.Private Sub rgCustomerContacts_OnNeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles rgCustomerContacts.NeedDataSource
02.        If RadTabStripAccount.SelectedTab.PageViewID = "PVContacts" Then
03.                Dim contactList As List(Of SML.Stars.Model.CustomerContact) = CustomerServices.GetCustomerContacts(customerID).ToList()
04.                rgCustomerContacts.DataSource = Mapper.Map(Of List(Of SML.Stars.Model.CustomerContact), List(Of CustomerContactViewModel))(contactList)
05.        End If
06.    End Sub
07. 
08.Private Sub rgCustomerContacts_OnUpdateCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles rgCustomerContacts.UpdateCommand
09.        Dim contactList As List(Of SML.Stars.Model.CustomerContact) = CustomerServices.GetCustomerContacts(customerID).ToList()
10.    End Sub
11. 
12.Protected Sub RadTabStripAccount_TabClick(ByVal sender As System.Object, ByVal e As RadTabStripEventArgs) Handles RadTabStripAccount.TabClick
13.        Select Case e.Tab.PageViewID
14.            Case "PVAttachments"
15.                ucUploadCustomerDocument.refresh()
16.            Case "PVContacts"
17.                firstTimeLoadContact = True
18.                'RGContacts.Rebind()
19.                rgCustomerContacts.Rebind()
20.        End Select
21.    End Sub

why the UpdateCommand is not firing at all?
Shinu
Top achievements
Rank 2
 answered on 21 Mar 2014
3 answers
56 views
Hi,
I am using Client Side Node Edit. If I put <script type="text/javascript">alert();</script> in the node name, the script executes. Is there any way to prevent it?
Princy
Top achievements
Rank 2
 answered on 21 Mar 2014
2 answers
88 views
Hi All,

I'm having a RadGrid in panel and also RadAjaxManager on the page with RadAjaxLoadingPanel on button click.
when we click on button RadGrid will load.
in RadGrid I'm having link button column. when i click on that link button it must redirect to another page..

this works fine with all IE document mode and User Agent String except for below case:
Document Mode: Edge
User Agent Mode: IE 10/9/8

Please suggest me the solution.

Thanks in advance

Rakesh
Top achievements
Rank 1
 answered on 21 Mar 2014
1 answer
92 views
Hi
I have this grid

<telerik:RadGrid ID="PriceListRadGrid" runat="server" OnNeedDataSource="PriceListRadGrid_NeedDataSource"
            EnableEmbeddedSkins="False" AllowPaging="True" OnItemCommand="PriceListRadGrid_ItemCommand"
            AllowSorting="True" OnItemCreated="PriceListRadGrid_ItemCreated" OnItemInserted="PriceListRadGrid_ItemInserted"
            OnPreRender="PriceListRadGrid_PreRender" OnItemDataBound="PriceListRadGrid_ItemDataBound"
            AllowFilteringByColumn="True" CellSpacing="0" Culture="it-IT" GridLines="None" ShowGroupPanel="True"
            Skin="MySkin" meta:resourcekey="PriceListRadGridResource1">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView AutoGenerateColumns="False" EditMode="InPlace" DataKeyNames="Id"
                CommandItemDisplay="Top">
                <CommandItemSettings AddNewRecordText="" RefreshText="" />
                <Columns>                   
 ....
  <telerik:GridTemplateColumn UniqueName="UnitOfMeasurementColumn"
                                                HeaderText="Currency"          
                                                DataField="UnitOfMeasurementId"
                                                SortExpression="UnitOfMeasurement.CodeAndDescription"                                               
                                                meta:resourcekey="GridTemplateColumnResource2">
 
                        <FilterTemplate>
                                <telerik:RadComboBox ID="UnitComboFilter"
                                                    runat="server"
                                                    DataTextField="Code"
                                                    DataValueField="Id"
                                                    AppendDataBoundItems="true"
                                                    SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("UnitOfMeasurementColumn").CurrentFilterValue %>'
                                                    OnClientLoad="ComboAlternativeRowColor"
                                                    OnClientSelectedIndexChanged="UnitComboFilter_SelectedIndexChanged"
                                                    Width="80px">                                                   
                                </telerik:RadComboBox>
                       
                            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                <script type="text/javascript">
                                    function UnitComboFilter_SelectedIndexChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("UnitOfMeasurementId", args.get_item().get_value(), "EqualTo");
                                    
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
 
                        <ItemTemplate>
                            <asp:Label runat="server" ID="UnitOfMeasurementCodeLbl" Text='<%# DataBinder.Eval(Container.DataItem,"UnitOfMeasurement.CodeAndDescription") %>'
                                meta:resourcekey="UnitOfMeasurementCodeLblResource1"></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadComboBox runat="server" DataTextField="CodeAndDescription" DataValueField="Id"
                                OnClientLoad="ComboAlternativeRowColor" ID="UnitOfMeasurementCombo" Width="200px"
                                Culture="it-IT" meta:resourcekey="UnitOfMeasurementComboResource1">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
 </Columns>          
            </MasterTableView>           
             <ClientSettings AllowDragToGroup="True">
                <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>               
            </ClientSettings>
            <GroupingSettings CaseSensitive="False" ShowUnGroupButton="True" />
            <FilterMenu EnableEmbeddedSkins="False">
            </FilterMenu>
            <HeaderContextMenu EnableEmbeddedSkins="False">
            </HeaderContextMenu>
        </telerik:RadGrid>

Here I fill the filter combobox

protected void PriceListRadGrid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            //popolo i filtri personalizzati
            if (e.Item is GridFilteringItem)
            {
                GridFilteringItem item = (GridFilteringItem)e.Item;
             
                RadComboBox unit = (RadComboBox)item.FindControl("UnitComboFilter");
                unit.DataSource = m_List.Select(p => p.UnitOfMeasurement).Distinct().ToList().OrderBy(p => p.Code);
                unit.DataBind();
                unit.Items.Insert(0, new RadComboBoxItem("", ""));
 
            }
....
}

When I choose an item from the filter combobox nothing happens


Thanks
Princy
Top achievements
Rank 2
 answered on 21 Mar 2014
1 answer
417 views
When using the radbutton (see markup below) I would like to know the controls method to change the cssclass...

I figured I would have access to a method like .set_cssClass... but I don't see that... Via the documentation.. 

What is provided is the get_cssClass...   


Anyway, I know how to do this via straight javascript or jquery.. but is there a telerik way?


<telerik:RadButton ID="ImageButtonStatusLock" CssClass="UnLockIcon" runat="server" Text="Image Button" OnClientClicked="OnClientClicked" AutoPostBack="false" ButtonType="StandardButton">
         <Image EnableImageButton="true" />
     </telerik:RadButton>
Shinu
Top achievements
Rank 2
 answered on 21 Mar 2014
1 answer
179 views

Good afternoon,

I have in my aspx page RadTextBox:

 

<

 

 

 

telerik:RadTextBox ID="CFNTextBox" runat="server" Font-Bold="true" TabIndex="1" Width="150px" CssClass="textbox" >

I would like fire on clientevent OnFocus and OnBlur to change backgroundColor.

When focus gets on textbox one color and when focus leaves textbox another color.

How can I do that?

Thanks so much for your help.

 

​​​​​​​​

 

Shinu
Top achievements
Rank 2
 answered on 21 Mar 2014
1 answer
302 views
I am using Telerik AJAX UI 
V2014.1.225.40.

I am a newbie to both Telerik and Visual 2012 but I am
learning fast.

I added a RadToolBar control to my WebPage and a RadPanelBar
on the left-hand side.  I noticed that on
the RadPanelBar property list, there is a property called “Visible”.  When this is set to false, the PanelBar
disappears.  Very cool!

So next, I wanted to see if I could make the PanelBar appear
(RadPanelBar.Visible=true) when the user clicked on a RadToolBar item (a C#
method in my Default.aspx.cs called “RadToolBar1_ButtonClick”).  So, I noticed that in the list of properties
for RadToolBar, there is a property called “OnClientButtonClicked”.  When I put an “event name” on that property,
Telerik created a JAVA Script HTML function that was empty.

First, what do I put into that empty function.

Second, what do I modify inside my Default.aspx.cs program
that would connect that JAVA Script Function to the method with the code that
sets the Property RadToolBar.Visible to true. 
I looked at the examples and could not found one that matched my needs.

How do I do that?
Shinu
Top achievements
Rank 2
 answered on 21 Mar 2014
1 answer
327 views
Hi
im exporting my grid to pdf but when using DateColumn its raising error System.InvalidCastException: Unable to cast object of type error
Princy
Top achievements
Rank 2
 answered on 21 Mar 2014
14 answers
637 views
I have a user control which I am using for Edits and Inserts. The usercontrol has properties on it that need to be set when rendered or when the editcommand is issued. I am trying to find the usercontrol in the RadGrid so that I can set its properties before it is shown in the edittemplate. The properties that need to be set change the user controls appearence when it is shown and the way it processes data, so the properties have to be set before data is bound....I have tried many events (the EditCommand follows) but the uc cannot be found and is allways Nothing/null.

 

 

Private Sub rg_EditCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles rg.EditCommand

 

 

 

    Dim uc As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)

 

    lbl_test.Text =

 

CType(uc, uc_Steps_Party).ID 'this is where the error occurs because uc == Nothing

 

 

 

End Sub

 

I have also tried:
EditCommand

ItemDataBound

ItemCreated

ItemCommand

Always a null exception refering tot he usercontrol.

The Telerick examples seem to only show finding the usercontrol (after) it has renedered like in the UpdateCommand or InsertCommand. I need to find the user control and set its properties before it gets to those events, when the usercontrol is first shown.


reguapo
Top achievements
Rank 1
 answered on 20 Mar 2014
4 answers
105 views
Hello

I add programmaticaly Tab on my TabStrip,
but if the user Refresh the WebPage, i loose My TabStrip and Multipage.

It's possible to Save Tab and Multipage when the user press F5 ?

this sample can  help or not ? : http://demos.telerik.com/aspnet-ajax/tabstrip/examples/application-scenarios/persisting-tabstrip-settings/defaultcs.aspx

Cause the restore not work , for Multipage.

thanks for your help
Olivier,
Olivier
Top achievements
Rank 2
 answered on 20 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?