Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
83 views

 this is my codeblock
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadGrid, {"ClientID":"ctl00_ContentPlaceHolder1_ucExtendedInfo_grdComprehensiveParts","ClientSettings":{"AllowAutoScrollOnDragDrop":true,"ShouldCreateRows":true,"DataBinding":{},"Selecting":{"CellSelectionMode":0},"Scrolling":{},"Resizing":{},"ClientMessages":{},"KeyboardNavigationSettings":{"AllowActiveRowCycle":false,"EnableKeyboardShortcuts":true,"FocusKey":89,"InitInsertKey":73,"RebindKey":82,"ExitEditInsertModeKey":27,"UpdateInsertItemKey":13,"DeleteActiveRow":127,"ExpandDetailTableKey":39,"CollapseDetailTableKey":37},"Animation":{}},"Skin":"Default","UniqueID":"ctl00$ContentPlaceHolder1$ucExtendedInfo$grdComprehensiveParts","_activeRowIndex":"","_controlToFocus":"","_currentPageIndex":0,"_editIndexes":"[]","_embeddedSkin":true,"_gridTableViewsData":"[{\"ClientID\":\"ctl00_ContentPlaceHolder1_ucExtendedInfo_grdComprehensiveParts_ctl00\",\"UniqueID\":\"ctl00$ContentPlaceHolder1$ucExtendedInfo$grdComprehensiveParts$ctl00\",\"PageSize\":7,\"PageCount\":1,\"EditMode\":\"InPlace\",\"AllowPaging\":true,\"CurrentPageIndex\":0,\"VirtualItemCount\":0,\"AllowMultiColumnSorting\":false,\"AllowNaturalSort\":true,\"AllowFilteringByColumn\":false,\"PageButtonCount\":10,\"HasDetailTables\":false,\"HasMultiHeaders\":false,\"PagerAlwaysVisible\":false,\"IsItemInserted\":false,\"clientDataKeyNames\":[],\"hasDetailItemTemplate\":false,\"_dataBindTemplates\":false,\"_selectedItemStyle\":\"\",\"_selectedItemStyleClass\":\"rgSelectedRow\",\"_columnsData\":[{\"UniqueName\":\"EditCommandColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":false,\"Groupable\":false,\"ColumnType\":\"GridEditCommandColumn\",\"ColumnGroupName\":\"\",\"DataTypeName\":\"System.String\",\"Display\":true},{\"UniqueName\":\"TemplateColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"ColumnGroupName\":\"\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"TemplateColumn1\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"ColumnGroupName\":\"\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"TemplateColumn2\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"ColumnGroupName\":\"\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"TemplateColumn3\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"ColumnGroupName\":\"\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"TemplateColumn4\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"ColumnGroupName\":\"\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"TemplateColumn5\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"ColumnGroupName\":\"\",\"DataTypeName\":\"System.String\",\"DataField\":\"\",\"Display\":true},{\"UniqueName\":\"DeleteColumn\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":false,\"Groupable\":false,\"ColumnType\":\"GridButtonColumn\",\"ColumnGroupName\":\"\",\"DataTypeName\":\"System.String\",\"ButtonType\":\"ImageButton\",\"CommandName\":\"Delete\",\"CommandArgument\":\"\",\"Text\":\"Delete\",\"DataTextField\":\"\",\"DataTextFormatString\":\"\",\"ImageUrl\":\"/Views/Vital Software Pty Ltd_files/Delete.gif\",\"Display\":true}]}]","_masterClientID":"ctl00_ContentPlaceHolder1_ucExtendedInfo_grdComprehensiveParts_ctl00","_shouldFocusOnPage":false,"allowMultiRowSelection":false,"clientStateFieldID":"ctl00_ContentPlaceHolder1_ucExtendedInfo_grdComprehensiveParts_ClientState"}, {"rowDblClick":RowDblClick1}, null, $get("ctl00_ContentPlaceHolder1_ucExtendedInfo_grdComprehensiveParts"));
});

  Getting error in IE browser as jscript:Rowdblclikc undefined except ie it is working fine in chrome and mozilla  browser,
<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
    <script type="text/javascript">
        function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
        }
           </script>
</telerik:RadCodeBlock>
 
<ClientSettings>
                        <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
                    </ClientSettings>


Thanks in advance.
Antonio Stoilkov
Telerik team
 answered on 18 Feb 2013
1 answer
235 views
Question 1:

I have a radgrid, the key index id QuestionID (DataKeyNames="QuestionID"). I have a move Up and Down radbutton - template column.   I need to switch the order when click the move up and down. At my back table, there is a field ordernumber, everytime I click the Up/Down, I need to update the ordernumber in back db and rebind the grid.  Is there a way that I can find the previous row's QuestionID on "ItemCommand" server side when I click "Up" button so that I can update the ordernumber for previous row?

I am able to make this work on a grid without filter. Basic I get QuestionID from my QuestionList, but after after filtering of the grid, it doesn't work any more, since my  QuestionList still the original QuestionList, not the List after filtering. Not sure how to get the QuestionList on serverside after filtering.



Question 2:

I need hide one of the column when do the filtering, how I do that?

Thank you!
Shinu
Top achievements
Rank 2
 answered on 18 Feb 2013
3 answers
172 views
Hi,

Do you have any examples on creating a custom footer?

I'm thinking of creating footer that have several labels like the below example

Qty Price Total
1 10.00 10.00
2 20.00 40.00
SubTotal: 50.00
Discount: <textbox here for user input>
Grand Total: <subtotal + discount>
Shinu
Top achievements
Rank 2
 answered on 18 Feb 2013
1 answer
46 views
Hi;
Please I need your help to lead me, I start to work with "RadScheduler Control"  but I need to synchronize information between the MS-Outlook and my RadScheduler, so how I can do that, I need your advice.
Thanks
Plamen
Telerik team
 answered on 18 Feb 2013
1 answer
150 views
Hi all

I create a grid and create some item template , but still can't remove a border or a separator

a screenshot is attached

and here is my code that attached too

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="GamesArchive.ascx.cs" Inherits="Pages_Controls_Others_GamesArchive" %>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
 
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" HorizontalAlign="NotSet"
    Width="800px" BorderColor="#180052">
    <br />
    <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" GridLines="None" MasterTableView-GridLines="None"
        AllowPaging="True" PageSize="10" CellSpacing="0" CellPadding="0" Skin="Web20" Width="800px"
        BackColor="#180052" BorderColor="#180052" BorderWidth="0" GroupingEnabled="False" ShowHeader="False">
        <MasterTableView DataSourceID="SqlDataSource1">
            <ItemTemplate>
                <center>
                    <div style="Width: 700px; height: 123px;">
                        <div style="Width: 120px; height: 120px; float: left; border: red 1px solid;">
                            <center>
                                <asp:Image ID="Image10" runat="server" Height="120px" Width="120px" ImageUrl='<%# "~/Games/Picss/" + Eval("Game_Avatar")%>'></asp:Image>
                            </center>
                        </div>
                        <div style="Width: 100px; height: 120px; float: left;"><br /></div>
                        <div style="Width: 248px; height: 120px; float: left; border: red 1px solid;">
                            <center>
                                <br />
                                <asp:Label ID="Label12" runat="server" ForeColor="White" CssClass="FontNormalBold" Text='<%# Eval("Game_Title")%>'></asp:Label>
                                <br />
                                <asp:Label ID="Label1" runat="server" ForeColor="White" CssClass="FontNormal" Text='<%# "<B>Categroy: </b>" +  Eval("Game_Category")%>'></asp:Label>
                            </center>
                        </div>
                        <div style="Width: 100px; height: 120px; float: left;"><br /></div>
                        <div style="Width: 120px; height: 120px; float: left; border: red 1px solid;">
                            <center>
                                <br />
                                <asp:HyperLink ID="HyperLink8" runat="server" NavigateUrl='<%# "~/Pages/GamesView.aspx?id=" + Eval("Game_ID")%>'>
                                    <asp:Image ID="Image11" runat="server" Height="60px" ImageUrl="~/Pics/Icons/OthersIcons/Game.PNG"></asp:Image>
                                </asp:HyperLink>
                            </center>
                             <asp:Label ID="Label11" runat="server" CssClass="FontNormal" ForeColor="White" Text="Play Now"></asp:Label>
                        </div>
                    </div>
                </center>
            </ItemTemplate>
            
            <CommandItemSettings ExportToPdfText="Export to PDF" />
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
            </ExpandCollapseColumn>
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>
</telerik:RadAjaxPanel>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>


thanks in advance
Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Feb 2013
1 answer
1.0K+ views
Hello, 
    I tried searching the forums but I did not find quite what I am looking for.  I would like to remove the horizontal scrollbar from the RadGrid control while still leaving it scrollable.  I am handling the scrolling with the RadSlider control.  What I am trying to do is have a dynamically built grid - no idea how many columns or rows it will have - with a footer, but with the horizontal scrollbar below it all.  We don't want the horizontal scrollbar between the grid data and the footer since the visual presentation is ...off. The ASPX page looks like

<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">
    <script type="text/javascript">
 
        $(document).ready(function () {
 
            $('#divLoading').hide();
 
            $('.monthHeaderRow').click(function () {
                var next;
 
                next = $(this).next();
 
                while (next.hasClass('monthDataRow')) {
                    next.toggle();
                    next = next.next();
                }
            });
 
            $('#divLoading').center();
             
        });
 
        function pageLoad(sender, args) {
            $find("<%= RadSlider1.ClientID %>").set_maximumValue($find("<%= grdTrackingReport.ClientID %>")._gridDataDiv.scrollWidth);
  
        function valueChange(sender, args) {
            var gridDataDiv = $find("<%= grdTrackingReport.ClientID %>")._gridDataDiv;
            if (sender.get_id() == "<%= RadSlider1.ClientID %>") {
                gridDataDiv.scrollLeft = sender.get_value();
            }
            else {
                gridDataDiv.scrollTop = sender.get_value();
            }
        }
    </script>
 
    <telerik:RadGrid ID="grdTrackingReport" runat="server" CssClass="Grid" OnItemDataBound="grdTrackingReport_ItemDataBound">
        <MasterTableView TableLayout="Fixed"></MasterTableView>
        <AlternatingItemStyle BackColor="#e8f2fd"></AlternatingItemStyle>
 
        <ClientSettings>
            <Selecting AllowRowSelect="true"></Selecting>
            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
        </ClientSettings>
    </telerik:RadGrid>
    <center>
       <telerik:RadSlider ID="RadSlider1" runat="server" OnClientValueChange="valueChange" Length="600" />
     </center>
 
</asp:Content>

with a CSS entry of:
.Grid div
        {
            overflow: hidden !important;
        }


Is this possible?  If so, what am I missing?

Thanks,
Mark
Shinu
Top achievements
Rank 2
 answered on 18 Feb 2013
1 answer
627 views
Hi,

I have a RadWindow and I need to display it as a confirm dialog on my Delete RadButton Click. I am setting my Button postback from JavaScript but I think its not working correctly. Please help me with code.

Thanks,
Ben.
Princy
Top achievements
Rank 2
 answered on 18 Feb 2013
2 answers
140 views
Hi,

I have Fromtime & ToTime in my application by using RadTimePicker control.In fromtime, i am displaying from 12:00 AM (Starttime) to 11:30 PM ( Endtime) with 30 min interval ,but if select 11:30 PM only , It's through an exception.It's urgent for me,please give me any solution for this.

Thanks in advance.

Regards
Sekhar.
Purnasekhar
Top achievements
Rank 1
 answered on 18 Feb 2013
1 answer
129 views
Maybe I'm not doing this the right way, but I'm trying to use RadWindow as a dialog box.  When I add controls (dropdownlist, textbox, listbox) to the RadWindow dynamically I'm not able to figure out how to get the new values of these dynamic controls on a postback.

I've tried 2 different approaches to adding the dynamic controls to the Radwindow.  In the first case I added a Panel dynamically to rwinProperties.ContentContainer and I add all my controls to this panel.  I look for the dynamic controls on rwinProperties.ContentContainer.Controls.  But I don't see them there after the postback.  I also tried creating a static Panel inside the ContentTemplate and adding all the dynamic controls to it.  Still no luck.

The postback is created by a radbutton I added statically in the RadWindow in the ContentTemplate.  I'm suspecting

So I'm suspecting that I can't these values from a postback, so how do I get them? 

Thanks
Sub SetSectionProperties(ByVal SectionID As String, SectionCount As String, ByVal SectionName As String)
     
    Dim SectionString As String = SectionID & "__" & SectionCount
    Dim Properties As New clsDashboardProperties(SectionID)
     
    Dim PropertyName As String
    Dim PropertyNameTitle As String
    Dim PropertyDesc As String
    Dim PropertyID As Integer
    Dim PropertyVisible As Boolean
    Dim ValueSet As String = ""
    Dim DefaultValue As String
    Dim ControlType As String = ""
    Dim lbl As Label
    Dim ddl As DropDownList
    Dim lbx As ListBox
    Dim tb As TextBox
    Dim lc As LiteralControl
    Dim ht As Hashtable = Session("SessionProperties")
    Dim pnl As New System.Web.UI.WebControls.Panel
    Dim pnl2 As New System.Web.UI.WebControls.Panel
    Dim oProp As clsDashboardPropertyMapItem
     
    Dim tbl As Table
    Dim tbl2 As Table 'For invisible properties
    Dim rw As TableRow
    Dim cell As TableCell
 
    pnl.ID = "pnlDialog"
    pnl.Width = New Unit("100%")
    pnl.Height = New Unit("100%")
    pnl.BorderWidth = 1
    pnl.BackColor = Drawing.Color.LightGray
    pnl.Visible = True
     
    rwinProperties.ContentContainer.Controls.Add(pnl)
 
    lbl = New Label
    lbl.Text = "<br/><b>  " & SectionName & " " & "Properties</b>"
    pnl.Controls.Add(lbl)
     
    lbl = New Label()
    lbl.Text = "<br/><br/>"
    pnl.Controls.Add(lbl)
     
    If Properties.Count >= 1 Then
        tbl = New Table
        tbl2 = New Table
        tbl2.Visible = False
         
        For Each prop As clsDashboardProperty In Properties
            PropertyName = prop.PropertyName
            PropertyNameTitle = prop.PropertyNameTitle
            ValueSet = prop.ValueSet
            ControlType = prop.ControlType
            PropertyDesc = prop.PropertyDesc
            PropertyID = prop.PropertyID
            PropertyVisible = prop.PropertyVisible
            DefaultValue = prop.DefaultValue
 
            rw = New TableRow()
            cell = New TableCell()
            cell.Width = 10
            cell.Text = " "
            rw.Controls.Add(cell)
             
            cell = New TableCell()
            cell.Text = "<b>" & PropertyNameTitle & ":</b>  "
            rw.Controls.Add(cell)
            cell = New TableCell()
             
            'Add some space
            cell = New TableCell()
            cell.Width = 10
            cell.Text = " "
            rw.Controls.Add(cell)
             
            Dim Values() As String = ValueSet.Split(",")
                     
            If ControlType = "lb" Then
                lbl = New Label
                lbl.Text = Values(0)
                lbl.ID = "lb_" & SectionString & "_" & PropertyID & "_" & PropertyName
                lbl.Visible = PropertyVisible
 
                cell.Controls.Add(lbl)
                         
            ElseIf ControlType = "ddl" Then
                ddl = New DropDownList
                ddl.Items.Add("Default")
 
                For Each Val As String In Values
                    ddl.Items.Add(Val)
                Next
 
                ddl.ID = "ddl_" & SectionString & "_" & PropertyID & "_" & PropertyName
                ddl.Visible = PropertyVisible
 
                ddlSelect(ddl, DefaultValue) 'Go select an item in the list
 
                cell.Controls.Add(ddl)
            ElseIf ControlType = "lbx" Then
                lbx = New ListBox
                lbx.Items.Add("Default")
                lbx.SelectionMode = ListSelectionMode.Multiple
                For Each Val As String In Values
                    lbx.Items.Add(Val)
                 Next
 
                lbx.ID = "ddl_" & SectionString & "_" & PropertyID & "_" & PropertyName
                lbx.Visible = PropertyVisible
 
                lbxSelect(lbx, DefaultValue) 'Go select items in the list
 
                cell.Controls.Add(lbx)
            ElseIf ControlType = "tb" Then
                tb = New TextBox
                tb.ID = "tb_" & SectionString & "_" & PropertyID & "_" & PropertyName
                tb.Text = Values(0)
                tb.Visible = PropertyVisible
 
                cell.Controls.Add(tb)
            ElseIf ControlType = "tbml" Then  'Multiline textbox
                tb = New TextBox
                tb.ID = "tb_" & SectionString & "_" & PropertyID & "_" & PropertyName
                tb.Text = Values(0)
                tb.Visible = PropertyVisible
 
                tb.TextMode = TextBoxMode.MultiLine
                tb.Rows = 4
                tb.Columns = 35
                tb.Font.Name = "Arial"
             
                cell.Controls.Add(tb)
            End If
 
            rw.Controls.Add(cell)
         
            'Add some space
            cell = New TableCell()
            cell.Width = 10
            cell.Text = " "
            rw.Controls.Add(cell)
             
            'Add the description of the property
            cell = New TableCell()
            cell.Text = "<i>" & PropertyDesc & "</i>  "
            rw.Controls.Add(cell)
 
            If PropertyVisible Then
                tbl.Controls.Add(rw)
            Else
                tbl2.Controls.Add(rw)
            End If
        Next
 
        pnl.Controls.Add(tbl)
             
        If tbl2.Rows.Count > 0 Then
            pnl.Controls.Add(tbl2)
        End If
         
        lc = New LiteralControl()
        lc.Text = "<br/>"
 
        pnl.Controls.Add(lc)
    Else
 
        lbl = New Label
        lbl.Text = "    No Properties available for this section.<br/><br/>"
        pnl.Controls.Add(lbl)
    End If
     
    lc = New LiteralControl()
    lc.Text = "  "
    pnl.Controls.Add(lc)      
 
End Sub
 
Sub rbtnUpdateProperties_Click(ByVal sender As Object, ByVal e As System.EventArgs)
     
    Dim pnl As Panel = rwinProperties.ContentContainer.FindControl("pnlDialog")
    For Each Ctl As Control In pnl.Controls
        If Ctl.ID.StartsWith("ddl") Then
            Dim ddl As DropDownList = CType(Ctl, DropDownList)
            Dim name As String = ddl.ID
            Dim value As String = ddl.SelectedValue
            Dim fields() As String = name.Split("_")
     
            AddToProperties(fields(1), fields(3), fields(5), name, value)
        ElseIf Ctl.ID.StartsWith("lbx") Then
            Dim lbx As ListBox = CType(Ctl, ListBox)
            Dim name As String = lbx.ID
            Dim value As String = GetListBoxSelectedValues(lbx)
            Dim fields() As String = name.Split("_")
     
            AddToProperties(fields(1), fields(3), fields(5), name, value)
                     
        ElseIf Ctl.ID.StartsWith("tb") Then
            Dim tb As TextBox = CType(Ctl, TextBox)
            Dim name As String = tb.ID
            Dim value As String = tb.Text
            Dim fields() As String = name.Split("_")
     
            AddToProperties(fields(1), fields(3), fields(5), name, value)
        ElseIf Ctl.ID.StartsWith("tbml") Then
            Dim tb As TextBox = CType(sender, TextBox)
            Dim name As String = tb.ID
            Dim value As String = tb.Text
            Dim fields() As String = name.Split("_")
     
            AddToProperties(fields(1), fields(3), fields(5), name, value)
        End If
    Next
     
    UpdateZone()
End Sub

<telerik:RadWindow runat="server" ID="rwinProperties" Modal="true" Height="450" Width="550" Title="Panel Properties"  CssClass="RadWindow"  >
    <ContentTemplate>
 
            <telerik:RadButton id="rbtnUpdateProperty" runat="server" Text="Update" EnableEmbeddedSkins="false" Skin="SOD_SKIN" AutoPostBack="true" OnClick="rbtnUpdateProperties_Click" />
                       
            <telerik:RadButton id="rbtnClosePropertyWindow" runat="server" Text="Cancel" EnableEmbeddedSkins="false" Skin="SOD_SKIN"    />
 
    </ContentTemplate>
</telerik:RadWindow>
Hunter
Top achievements
Rank 1
 answered on 18 Feb 2013
1 answer
211 views
I want to let some users download some files from my website and I don't want them to see the physical path of the downloading file.
I moved the files in a folder outside of my web folder and use Response.WriteFile(filePath) to download them. this help me to hide the path but this method doesn't support resume download which I really want it.
So what method you recommend I use?
Thanks
moegal
Top achievements
Rank 1
 answered on 17 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?