Telerik Forums
UI for ASP.NET AJAX Forum
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
661 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
163 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
166 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
248 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
2 answers
203 views
When using the RadGrid in the following example the RadGrid height does not account for the height of content in the master page resulting in a vertical scroll bar being displayed. Do you have a recommended approach for correctly resizing the RadGrid when used with a master page?

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Deals.master.cs" Inherits="DueDiligenceGrid.Deals1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder>
</head>
<body>
    <div style="height: 100px; background-color: Blue;"></div>
    <form id="form1" runat="server">
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
          
        </asp:ContentPlaceHolder>
    </form>
</body>
</html>
  
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Deals.aspx.cs" Inherits="DueDiligenceGrid.Deals" MasterPageFile="~/Deals.Master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/Control/DealGrid.ascx" TagName="TelerikDealGrid" TagPrefix="dd" %>
  
<asp:Content ID="HeadContent" ContentPlaceHolderID="head" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <style type="text/css">
            html  
            {   
                overflow:auto; 
            }
                    
            html, 
            body
            {   
                height: 100%;   
                margin: 0px;   
                padding: 0px;  
            }   
        </style>
    </telerik:RadCodeBlock>
</asp:Content>
  
<asp:Content ID="MainContent" ContentPlaceholderID="ContentPlaceHolder1" runat="server">
    <telerik:RadSplitter 
        ID="TelerikDealGridSplitter" 
        runat="server"
        Orientation="Horizontal"
        Width="100%"
        Height="100%">
        <telerik:RadPane 
            ID="TelerikDealSearchPane" 
            runat="server"
            Height="100" 
            MaxHeight="100"
            ShowContentDuringLoad="false">
        </telerik:RadPane>
        <telerik:RadSplitBar 
            CollapseMode="Forward"
            ID="TelerikDealGridSplitBar" 
            runat="server" 
            EnableResize="True">
        </telerik:RadSplitBar>
        <telerik:RadPane ID="TelerikDealGridPane" runat="server" ShowContentDuringLoad="false">
            <telerik:RadScriptManager ID="DealScriptManager" runat="server" />
            <dd:TelerikDealGrid ID="TelerikDealGrid" runat="server" />      
        </telerik:RadPane>
    </telerik:RadSplitter>
</asp:Content>
  
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DealGrid.ascx.cs" Inherits="DueDiligenceGrid.Control.DealGrid" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadAjaxManager ID="TelerikDealGridAjaxManager" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="TelerikDealGrid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="TelerikDealGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
    <telerik:RadGrid 
        ID="TelerikDealGrid"
        runat="server" 
        OnSortCommand="TelerikDealGrid_SortCommand" 
        OnPageIndexChanged="TelerikDealGrid_PageIndexChanged"
        Width="100%"
        Height="100%" 
        OnPageSizeChanged="TelerikDealGrid_PageSizeChanged" 
        AllowSorting="True"
        PageSize="15" 
        AllowPaging="True" 
        AllowMultiRowSelection="True" 
        ShowGroupPanel="true"
        GridLines="None"
        Style="border: 0;">
        <MasterTableView Width="100%" Summary="Deal table" CommandItemDisplay="TopAndBottom">
            <CommandItemTemplate>
                <div style="height: 30px; text-align: left; background-color:Red">
                  
                </div>
            </CommandItemTemplate>
        </MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
        </ClientSettings>
        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
    </telerik:RadGrid>
David
Top achievements
Rank 1
 answered on 17 Feb 2013
4 answers
272 views
Having spend way to many hours fighting with the javascript intellisense in VS2010 i am currently looking into ScriptSharp again - though there have been posts in the past I havent seen any comments recently.

If you havent heard of ScriptShart, you can read an overview of it here: http://projects.nikhilk.net/ScriptSharp - i quote,

"Script# is a C# compiler that generates JavaScript (instead of MSIL) for use in Web applications or other script-based applications such as Windows Vista Sidebar gadgets. The primary goal of Script# is to provide a more productive scripting environment for developing Ajax applications that are more maintainable over the long term by leveraging various aspects of the C# development model....."

Is there anyone using / wanting to use ScriptSharp with the telerik client side apis??

Does anyone have ScriptSharp libraries for the Telerik controls (if so, are you willing to share) ?

Is there anyone interested in working together with me to build a set of import libraries for ScriptSharp (my main interest is obviously only in the controls and the mehtods & properties that i need to use, but i am willing to invest some extra time adding all the methods & properties).

...or, what are your feelings about ScriptSharp (and other similar tools), is it a waste of time/effort?? I would love to hear the Telerik communities views on the matter.
Karl Maynard
Top achievements
Rank 1
 answered on 17 Feb 2013
8 answers
399 views
I have used radcombobox in RadGrid column

See my Aspx code:
<telerik:RadGrid ID="RadGrid1" runat="server" OnItemDataBound="RadGrid1_ItemDataBound"
                                            Skin="Office2007" GridLines="None" OnItemCreated="RadGrid1_ItemCreated">
                                            <MasterTableView AutoGenerateColumns="False" IsFilterItemExpanded="false">
                                                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                                </RowIndicatorColumn>
                                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                                </ExpandCollapseColumn>
                                                <Columns>
                                                    <telerik:GridTemplateColumn HeaderText="<%$ Resources:PurchaseOrder, SN %>">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Sno" runat="server" Text="Label" Width="35px" Style="text-align: center">
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="<%$ Resources:PurchaseOrder, Itm %>">
                                                        <ItemTemplate>
                                                           <telerik:RadComboBox ID="itemcode" runat="server" Width="100px" ShowToggleImage="false"
                                                                DataTextField="itemno" DataValueField="itemno" EnableAutomaticLoadOnDemand="true"
                                                                ItemsPerRequest="10" ToolTip="Item ComboBox" ShowMoreResultsBox="true" AutoPostBack="true"
                                                                OnSelectedIndexChanged="Item_SelectedIndexChanged" EnableVirtualScrolling="true"
                                                                Skin="Simple" AccessKey="T" MarkFirstMatch="true" AppendDataBoundItems="true" >
                                                            </telerik:RadComboBox>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="<%$ Resources:PurchaseOrder, WrDesc %>">
                                                        <ItemTemplate>
                                                           <telerik:RadComboBox ID="Description" runat="server" Width="250px" ShowToggleImage="false"
                                                                DataTextField="workdescription" DataValueField="workdescription" EnableAutomaticLoadOnDemand="True"
                                                                ItemsPerRequest="10" ToolTip="Item ComboBox" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                                                                Skin="Simple" AccessKey="T" MarkFirstMatch="true" OnSelectedIndexChanged="Description_SelectedIndexChanged"
                                                                AutoPostBack="true">
                                                            </telerik:RadComboBox>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="<%$ Resources:PurchaseOrder, Cat %>">
                                                        <ItemTemplate>
                                                            <telerik:RadTextBox ID="Category" runat="server" Width="100px" AutoCompleteType="Disabled"
                                                                FocusedStyle-BackColor="Lavender" MaxLength="30" CssClass="Capitalize1" Text='<%# Bind("category") %>'
                                                                onkeydown="return (event.keyCode!=13);">
                                                            </telerik:RadTextBox>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="<%$ Resources:PurchaseOrder, ArtNo %>">
                                                        <ItemTemplate>
                                                            <telerik:RadTextBox ID="ArticleNo" runat="server" Width="100px" AutoCompleteType="Disabled"
                                                                FocusedStyle-BackColor="Lavender" MaxLength="15" CssClass="Capitalize1" Text='<%# Bind("articleno") %>'
                                                                onkeydown="return (event.keyCode!=13);">
                                                            </telerik:RadTextBox>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="<%$ Resources:PurchaseOrder, Qty %>">
                                                        <ItemTemplate>
                                                            <telerik:RadNumericTextBox ID="Quantity" runat="server" Width="50px" AutoCompleteType="Disabled"
                                                                FocusedStyle-BackColor="Yellow" MaxLength="5" IncrementSettings-InterceptMouseWheel="false"
                                                                NumberFormat-GroupSizes="5" Text='<%# Bind("quantity") %>' onkeydown="return (event.keyCode!=13);">
                                                                <ClientEvents OnKeyPress="NoDecimal" />
                                                            </telerik:RadNumericTextBox>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="<%$ Resources:PurchaseOrder, Unt %>" Visible="false">
                                                        <ItemTemplate>
                                                            <telerik:RadComboBox ID="RadComboBox_Unit" runat="server" AutoPostBack="false" AppendDataBoundItems="true"
                                                                FocusedStyle-BackColor="Lavender" Width="70px" DataValueField="unit" DataTextField="unit"
                                                                Enabled="false" Visible="false">
                                                            </telerik:RadComboBox>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="<%$ Resources:PurchaseOrder, ppu %>">
                                                        <ItemTemplate>
                                                            <telerik:RadNumericTextBox ID="price" runat="server" Width="80px" AutoCompleteType="Disabled"
                                                                FocusedStyle-BackColor="Yellow" MaxLength="8" IncrementSettings-InterceptMouseWheel="false"
                                                                NumberFormat-GroupSizes="8" Text='<%# Bind("price") %>' onkeydown="return (event.keyCode!=13);">
                                                            </telerik:RadNumericTextBox>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="<%$ Resources:PurchaseOrder, amt %>">
                                                        <ItemTemplate>
                                                            <telerik:RadNumericTextBox ID="Amount" runat="server" Width="85px" ReadOnly="true"
                                                                ReadOnlyStyle-ForeColor="Red" MaxLength="8" Text='<%# Bind("amount") %>' onkeydown="return (event.keyCode!=13);">
                                                            </telerik:RadNumericTextBox>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                </Columns>
                                                <EditFormSettings>
                                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                    </EditColumn>
                                                </EditFormSettings>
                                            </MasterTableView>
                                            <ClientSettings EnablePostBackOnRowClick="false" AllowDragToGroup="true">
                                                <Selecting AllowRowSelect="true" />
                                            </ClientSettings>
                                            <FilterMenu EnableImageSprites="False">
                                            </FilterMenu>
                                            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_">
                                            </HeaderContextMenu>
                                        </telerik:RadGrid>

See my Po image select items
when i click Add row button clear the first and second column are empty to bind (see My Po1 image)
My cs coding is :

protected void btnaddrow_Click(object sender, EventArgs e)
        {
            DataTable dt = (DataTable)Session["PurchaseOrder"];
            int finalrow = dt.Rows.Count + 1;
            object[] emptyrow = new object[columcount];
            emptyrow[0] = finalrow.ToString();
            dt.Rows.Add(emptyrow);

            assigndt2(dt);

            tabledata1 = dt;
            RadGrid1.DataSource = tabledata1;
            RadGrid1.DataBind();

            for (int i = 0; i <= RadGrid1.Items.Count - 1; i++)
            {
                RadComboBox ddlitemcode = (RadComboBox)RadGrid1.Items[i].FindControl("itemcode");

                string orgreqfinal = ("select itemno from dsprojectwork " +
                                        "where status <> 'del'");

                ddlitemcode.DataSource = oDBClientADO.GetDataTable(orgreqfinal);// UnitName.DataSource = orgreqfinal;
                ddlitemcode.DataValueField = "itemno";
                ddlitemcode.DataTextField = "itemno";
            }
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                RadComboBox ddlitemcode = (RadComboBox)RadGrid1.Items[i].FindControl("itemcode");

                if (dt.Rows.Count > i)
                {
                    if (dt.Rows[i]["itemno"].ToString() != "")
                    {
                        ddlitemcode.SelectedValue = dt.Rows[i]["itemno"].ToString();
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
        }

  private DataTable tabledata1
        {
            get
            {
                DataTable dt = (DataTable)Session["PurchaseOrder"];

                if (dt == null)
                {
                    dt = new DataTable();
                    object[] emptyrow = new object[columcount];
                    dt.Columns.Add("Sno", typeof(string));
                    dt.Columns.Add("itemno", typeof(string));
                    dt.Columns.Add("workdescription", typeof(string));
                    dt.Columns.Add("Category", typeof(string));
                    dt.Columns.Add("ArticleNo", typeof(string));
                    dt.Columns.Add("Quantity", typeof(string));
                    dt.Columns.Add("Unit", typeof(string));
                    dt.Columns.Add("price", typeof(string));
                    dt.Columns.Add("Amount", typeof(string));

                    for (int i = 1; i < rowcount + 1; i++)
                    {
                        emptyrow[0] = i.ToString();
                        dt.Rows.Add(emptyrow);
                    }
                    tabledata1 = dt;
                }
                return dt;
            }
            set
            {
                Session["PurchaseOrder"] = value;
            }
        }

        private void assigndt2(DataTable dt)
        {
            RadComboBox r1;
            RadNumericTextBox rn1;
            RadTextBox rt1;
            for (int i = 0; i <= RadGrid1.Items.Count - 1; i++)
            {
                r1 = (RadComboBox)RadGrid1.Items[i].FindControl("itemcode");
                dt.Rows[i]["itemno"] = r1.SelectedValue;
                r1 = (RadComboBox)RadGrid1.Items[i].FindControl("Description");
                dt.Rows[i]["workdescription"] = r1.SelectedValue;
                rt1 = (RadTextBox)RadGrid1.Items[i].FindControl("Category");
                dt.Rows[i]["Category"] = rt1.Text;
                rt1 = (RadTextBox)RadGrid1.Items[i].FindControl("ArticleNo");
                dt.Rows[i]["ArticleNo"] = rt1.Text;
                rn1 = (RadNumericTextBox)RadGrid1.Items[i].FindControl("Quantity");
                dt.Rows[i]["Quantity"] = rn1.Text;
                rn1 = (RadNumericTextBox)RadGrid1.Items[i].FindControl("price");
                dt.Rows[i]["price"] = rn1.Text;
                rn1 = (RadNumericTextBox)RadGrid1.Items[i].FindControl("Amount");
                dt.Rows[i]["Amount"] = rn1.Text;
            }
        }

Advance Thanks
Ansari

 
Tamim
Top achievements
Rank 1
 answered on 17 Feb 2013
3 answers
256 views
I would like to use images with the tab control, but to limit the number of requests for files, I want to use a single sprite image and be able to position the background through CSS.

the ImageUrl property renders an img tag, so I dont think i can use that.

I could try one of the CssClass properties for each tag, but not sure if I'd be able to position the text to the right of the image properly.

I could put a Div tag in the Text property with a class defined for the background image and positioning. but this seems a bit hacky.

Same question for the Toolbar control, whats the best way to make it work with a sprite.

Thanks for any advice,

Adam Nelson
Ali
Top achievements
Rank 1
 answered on 17 Feb 2013
1 answer
123 views

I want add " from every assigned after that

ProjId.Text = "";
                            string md = empcnt[0].Projectid.ToString();
                            string[] md1 = md.Split(',');
 
                            for (int i = 0; i < md1.Length; i++)
                            {
                                string item1 = md1[i].ToString();
                                if (i == 0)
                                    ProjId.Text += item1 + '"' + ',';
                                else if (i == md1.Length - 1)
                                    ProjId.Text += '"' + item1;
                                else
                                    ProjId.Text += '"' + item1 + '"' + ',';
                            }
                            //int cnt = ProjId.Text.Count() - 1;
                            //string Value = ProjId.Text.Substring(0, cnt);
                            List<string> listIDs = new List<string> { ProjId.Text };
 
                            var ProjMas = (from a in db.DSProjectMasters where a.FinalStatus == "Cls" && a.Status != "Del" && a.CompCode == compcode && listIDs.Contains(a.ProjectCode) select new { a.ProjectCode, a.ProjectTitle }).ToList();

but result is come line that one extra back slash also there .
"WEST\",\"xs"
how i remove it


or after assign i want like that i want to remove \
"west","xs" this is the i want to output


Thanks Advance,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 17 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?