Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
98 views
Hi everyone,

I have one scenario where i need to apply  two behaviors Close,Move

here is my code
RadWindow RadWindow1 = new RadWindow();
RadWindow1.ID = AGCommon.ToString(item.Id);
RadWindow1.VisibleOnPageLoad = true;
RadWindow1.Width = 800;
RadWindow1.Height = 550;
RadWindow1.Behaviors = WindowBehaviors.Close;
RadWindow1.Behaviors = WindowBehaviors.Move;
RadWindow1.NavigateUrl = "Tests.aspx";
RadWindowManager1.Windows.Add(RadWindow1);
But it takes only shows Move behavior . I need both Close,Move behaviors.

Can anyone help me out.

Thanks
Princy
Top achievements
Rank 2
 answered on 07 Jun 2013
3 answers
54 views
Hello,
I have a telerik RadComboBox which uses load on demand functionality. The issue that I have is that once I type a text to the combobox and selects an item, That item should not be loaded again onto the combobox box when requested. Its like the item was removed from the list.

Thanks.
Nencho
Telerik team
 answered on 07 Jun 2013
1 answer
59 views
I had a hyperlink column in the radgrid, the link then open a radwindow.

the code works fine that can open a radwindow, but the window size cannot resize no matter i set

the following are my code:

ASP

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">      
    <script type="text/javascript">
  
            function ShowSIMPER(id) {
                window.radopen("HR_SIMPER_view.aspx?SIMPER_ID=" + id + "&UserID=0", "SIMPER_PDF" );
                return false;
            }
 
        </script>
 
    </telerik:RadCodeBlock>

 

<telerik:RadGrid ID="RadGrid2" runat="server" AllowFilteringByColumn="True"
                                      AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"  OnItemCreated="RadGrid2_ItemCreated"
                                      CellSpacing="0" DataSourceID="LDS_SIMPER" GridLines="None" Width="40%">
<MasterTableView DataKeyNames="SIMPER_ID" DataSourceID="LDS_SIMPER">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
<%--    <telerik:GridHyperLinkColumn Text="View/Edit" DataNavigateUrlFormatString="~/HR/HR_SIMPER_view.aspx?SIMPER_ID={0}&UserID=0" DataNavigateUrlFields="SIMPER_ID" UniqueName="HyperLinkColumn" AllowFiltering="false" Target="_blank">  
</telerik:GridHyperLinkColumn>--%>
                <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                    <ItemTemplate>
                        <asp:HyperLink ID="ViewLink" runat="server" Text="View"></asp:HyperLink>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="Valid_From" DataType="System.DateTime"
            FilterControlAltText="Filter Valid_From column" HeaderText="Valid_From"
            SortExpression="Valid_From" UniqueName="Valid_From" DataFormatString ="{0: dd-MMM-yyyy}">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Valid_Till" DataType="System.DateTime"
            FilterControlAltText="Filter Valid_Till column" HeaderText="Valid_Till"
            SortExpression="Valid_Till" UniqueName="Valid_Till" DataFormatString ="{0: dd-MMM-yyyy}">
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
 
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
</MasterTableView>
 
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
                                  </telerik:RadGrid>
 
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="SIMPER_PDF" runat="server" Title="View SIMPER Card" Height="700px"
                Width="710px" Left="50px" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusBar="false"
                Modal="false">
            </telerik:RadWindow>
        </Windows>
        </telerik:RadWindowManager>
 
                                  <asp:LinqDataSource ID="LDS_SIMPER" runat="server"
                                      ContextTypeName="dcLRDBDataContext" EntityTypeName=""
                                      TableName="db_Employee_Simper_Records" Where="UserID == @UserID and parent_id == null">
                                      <WhereParameters>
                                          <asp:QueryStringParameter Name="UserID" QueryStringField="UserID"
                                              Type="Int32" />
                                      </WhereParameters>
                                  </asp:LinqDataSource>

 

Code behind (VB)

Protected Sub RadGrid2_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
    If TypeOf e.Item Is GridDataItem Then
        Dim editLink As HyperLink = DirectCast(e.Item.FindControl("ViewLink"), HyperLink)
        editLink.Attributes("href") = "javascript:void(0);"
        editLink.Attributes("onclick") = [String].Format("return ShowSIMPER('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("SIMPER_ID"), e.Item.ItemIndex)
    End If
End Sub

 





Shinu
Top achievements
Rank 2
 answered on 07 Jun 2013
1 answer
195 views
Hello,

I currently have a rad grid that on row insert and edit command displays a regular ASP DropDownList box populated from code behind in the OnItemDataBound event handler. Everything is working fine, the values are populated and the data is stored on insert/update, however changing the EditMode to InPlace on the master table view creates an empty box with no data populated. What is changing here?

Here is the first part of my ASP for the grid

<telerik:RadGrid ID="OrderItemGrid" runat="server" AutoGenerateColumns="False"
    CellSpacing="0" GridLines="None">
    <MasterTableView CommandItemDisplay="Top" DataKeyNames="OrderItemID" EditMode="InPlace">
        <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Quick-Add New Order Item" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
            Visible="True">
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
            Visible="True">
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn DataField="OrderItemID"
                FilterControlAltText="Filter OrderItemID column" HeaderText="Item ID"
                ReadOnly="True" UniqueName="OrderItemID">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="CatID" FilterControlAltText="Filter CatID column" HeaderText="Category" UniqueName="CatID">
                <EditItemTemplate>
                    <asp:DropDownList ID="DDCategory" runat="server"></asp:DropDownList>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:DropDownList ID="DDCategory" runat="server"></asp:DropDownList>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="CatIDLabel" runat="server" Text='<%# Eval("CatID") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>


And here is the relevant code-behind


Protected Sub OrderItemGrid_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles OrderItemGrid.ItemDataBound
    If TypeOf (e.Item) Is GridEditFormInsertItem And e.Item.IsInEditMode Then
        Dim editItem As GridEditFormInsertItem = CType(e.Item, GridEditFormInsertItem)
        Dim dropList As DropDownList = CType(editItem("CatID").FindControl("DDCategory"), DropDownList)
        Using dbContext As New MatrixORMModelVB()
            dropList.DataSource = dbContext.Categories.ToList()
            dropList.DataTextField = "CategoryName"
            dropList.DataValueField = "CategoriesID"
            dropList.DataBind()
        End Using
    ElseIf TypeOf (e.Item) Is GridDataItem And Not e.Item.IsInEditMode Then
        Dim editItem As GridDataItem = CType(e.Item, GridDataItem)
        Dim label As Label = CType(editItem("CatID").FindControl("CatIDLabel"), Label)
        Using dbContext As New MatrixORMModelVB()
            Dim temp As String = label.Text
            Dim tempCat As MatrixORM.Category = dbContext.Categories.Where(Function(c) c.CategoriesID = temp).First()
            label.Text = tempCat.CategoryName
        End Using
    End If
End Sub

If I remove EditMode="InPlace" from the MasterTableView things work perfectly. Why the difference?

Thanks
Princy
Top achievements
Rank 2
 answered on 07 Jun 2013
1 answer
129 views
Hi,
How to access the TreeListEditCommandColumn in the code behind. I was trying to access from code behind, but i could not able to acess.
Please help me out.Please refer the below code for your reference.

If i can acces the

TreeListEditCommandColumn , from that i can able to hide the plus button in the parent node. or i can set the visible true/false.

<telerik:RadTreeList ID="treeListClientBudget" runat="server" OnNeedDataSource="treeListClientBudget_NeedDataSource" Visible="false" HideExpandCollapseButtonIfNoChildren="true"
                            DataKeyNames="DataKey" Height="200px" OnChildItemsDataBind="treeListClientBudget_ChildItemsDataBind" OnItemDataBound="treeListClientBudget_ItemDataBound"
                            ParentDataKeyNames="ParentKey" AutoGenerateColumns="false" AllowLoadOnDemand="true" EditMode="InPlace" OnUpdateCommand="treeListClientBudget_UpdateCommand" OnInsertCommand="treeListClientBudget_InsertCommand" OnCancelCommand="treeListClientBudget_CancelCommand" OnEditCommand="treeListClientBudget_EditCommand">
                            <ClientSettings Selecting-AllowItemSelection="true" Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true" >
                                <Selecting AllowToggleSelection="true"/>
                            </ClientSettings>
 
                            <Columns>
                                <telerik:TreeListEditCommandColumn   UniqueName="InsertCommandColumn"  ShowAddButton="false" ButtonType="ImageButton" ShowEditButton="false" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center">
                                     <HeaderStyle Width="60px" />
                                    <ItemStyle Width="60px" />
                                </telerik:TreeListEditCommandColumn>
                                <telerik:TreeListButtonColumn CommandName="Edit" Text="Edit" UniqueName="EditCommandColumn" ButtonType="ImageButton" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center">
                                    
                                </telerik:TreeListButtonColumn>
 
                                <telerik:TreeListButtonColumn UniqueName="DeleteCommandColumn" Text="Delete" CommandName="Delete" ButtonType="ImageButton" HeaderStyle-Width="30px"></telerik:TreeListButtonColumn>
                                <telerik:TreeListBoundColumn DataField="DisplayName" UniqueName="DisplayName" ReadOnly="true"
                                    HeaderText="Month/Classification">   </telerik:RadTreeList>

 

please refer the code for Codebehind .CS

 

protected void treeListClientBudget_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
    {
 
 
        if (e.Item is TreeListDataItem)
        {
            TreeListDataItem item = e.Item as TreeListDataItem;
 
            //hdnClassificationId.Value = Convert.ToString(item.GetDataKeyValue("DataKey"));
            switch (item.HierarchyIndex.NestedLevel)
            {
                case 0:
                    item.BackColor = System.Drawing.Color.LightYellow;
                    break;
                case 1:
                    item.BackColor = System.Drawing.Color.YellowGreen;
                     
                    ImageButton treelist = item["TreeListEditCommandColumn"].FindControl("InsertCommandColumn") as ImageButton;
                    //treelist.ShowAddButton = true;
                    //    hdnClassificationId.Value =Convert.ToString( item.GetDataKeyValue("DataKey"));
                    break;
                case 2:
                    item.BackColor = System.Drawing.Color.LightPink;
                    item["InsertCommandColumn"].Visible = true;
                    break;
            }
        }
    }
Andrey
Telerik team
 answered on 07 Jun 2013
4 answers
201 views
So I would like to create a Grid with a Grid template column that contains a radiobutton and a textbox. On the click of the radiobutton, i want the textbox to appear to the right of the grid. Any help on starting this would be greatly appreciated.
Princy
Top achievements
Rank 2
 answered on 07 Jun 2013
2 answers
241 views
Hi guys. I have implemented a RadGrid with Edit and Insert Mode and filter capabilities.

When filtering the RadGrid while in edit mode, the edited row seems to be based on the row number, eg, when I'm editing row number 3, and while editing, the grid is filtered, the edited row remains at row number 3 even though the row of the record I'm currently editing may have changed.

For Example, if I'm doing auto CRUD on this table with in place editing

[id] [code]
-----------------------
[01] codeX
[02] codeY
[03] codeY

and the row being edited is the 2nd one ([02] codeY)

if a filter (using the RadGrid default filter) is done on Code "EqualTo" 'codeY' such that the result becomes

[id] [code]
-----------------------
[02] codeY
[03] codeY

the edited row is still the 2nd one ([03] codeY) even though the row originally being edited is ([02] codeY)

Is this the expected behaviour, or is there are way to instruct the RadGrid to look for the record to set the edit mode on that particular record again? If not, is there a way to automatically cancel edit mode/insert mode just before filtering? Or to disable all filtering controls while user is in edit/insert mode? Thanks for reading.
Joey
Top achievements
Rank 1
 answered on 07 Jun 2013
1 answer
51 views
Hi I have to create a grid dynamically.  I can do most of it in vb code behind but I also need an edit column?  What is the syntax for this creation?

        boundColumn = New GridBoundColumn()
        dgCompDetails.MasterTableView.Columns.Add(boundColumn)
        boundColumn.DataField = "ippComponentSrcValue"
        boundColumn.UniqueName = "dgippComponentSrcValue"
        boundColumn.Display = True
        boundColumn.HeaderText = "Value"

I need the next column to be a

GridEditCommandColumn

but can not figure out the correct syntax.

Thanks.

Shinu
Top achievements
Rank 2
 answered on 07 Jun 2013
4 answers
175 views
I had a hard time figuring out DatePicker's MonthView CSS is broken when using AntiXssEncoder library in the project. It somehow prevents MonthView to render properly. Is there a way to fix MonthView in DatePicker when using with AntiXssEncoder? May be manually adding some css lines and fixind the view?
Robert
Top achievements
Rank 1
 answered on 06 Jun 2013
1 answer
204 views
I'm using Telerik ASP.NET AJAX controls (ver. 2010.2.929.40).  When I use the AntiXssEncoder as the default encoder...

    <httpRuntime encoderType="Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary" />

The links on the radtabstrip controls in our application get rendered with %23 instead of # as the hyperlink....

i.e.
With AntiXssLibrary

<a class="rtsLink rtsAfter" href="%23"> 

Instead of without the AntiXssLibrary...

<a class="rtsLink rtsAfter" href="#">

Clicking on the first link results in a 404 error page.

Is there a solution for this problem? 
Robert
Top achievements
Rank 1
 answered on 06 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?