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


Hi,
 How to Bind checkbox value in radgrid Template column clientside code
 
Sample Coding:
  <asp:CheckBox runat="server" ID="Byemail" Checked='<%#Bind("Byemail") %>' onkeydown="return (event.keyCode!=13);"
                                            OnCheckedChanged="CheckedChanged" AutoPostBack="true" />

RadGrid full coding

<telerik:RadGrid ID="RadGrid1" runat="server" Width="99%" Skin="Office2007" Visible="false"
                        OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand">
                        <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:GridBoundColumn ReadOnly="true" DataField="EmailId" HeaderText="EmailId"
                                    SortExpression="EmailId" UniqueName="EmailId" MaxLength="50" HeaderStyle-Width="20px"
                                    Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="Addresse Type">
                                    <ItemTemplate>
                                         <asp:Label ID="addrestype" runat="server" Text='<%#Bind("addrestype") %>' Width="16px" Style="text-align: left">
                                        </asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Party Type">
                                    <ItemTemplate>
                                        <telerik:RadTextBox ID="Partype" runat="server" Text='<%#Bind("Partype") %>' ReadOnly="true" Width="120px" onkeydown="return (event.keyCode!=13);">
                                        </telerik:RadTextBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Company Name">
                                    <ItemTemplate>
                                        <telerik:RadTextBox ID="Companyname" runat="server" Text='<%#Bind("Companyname") %>' ReadOnly="true" Width="300px"
                                            onkeydown="return (event.keyCode!=13);">
                                        </telerik:RadTextBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Officer Name">
                                    <ItemTemplate>
                                        <telerik:RadTextBox ID="Contactperson" runat="server" Text='<%#Bind("Contactperson") %>' ReadOnly="true" Width="275px"
                                            onkeydown="return (event.keyCode!=13);">
                                        </telerik:RadTextBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Email">
                                    <ItemTemplate>
                                        <telerik:RadTextBox ID="Emailid" runat="server" Text='<%#Bind("Emailid") %>' Width="275px" onkeydown="return (event.keyCode!=13);"
                                            MaxLength="100" AutoCompleteType="Disabled" ReadOnly="true">
                                        </telerik:RadTextBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="By Email">
                                    <ItemTemplate>
                                        <asp:CheckBox runat="server" ID="Byemail" Checked='<%#Convert.ToBoolean(Eval("Byemail")) %>' onkeydown="return (event.keyCode!=13);"
                                            OnCheckedChanged="CheckedChanged" AutoPostBack="true" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="DEL">
                                    <ItemTemplate>
                                        <%-- <telerik:RadButton ID="Button4" runat="server" CausesValidation="false" CommandName="Delete"
                                            Icon-PrimaryIconCssClass="rbCancel">
                                        </telerik:RadButton>--%>
                                        <telerik:RadButton ID="Button4" runat="server" UseSubmitBehavior="false" CommandName="Delete"
                                            Icon-PrimaryIconCssClass="rbCancel" AutoPostBack="true">
                                        </telerik:RadButton>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <%--<telerik:GridButtonColumn HeaderText="Delete" CommandName="Delete" ButtonType="ImageButton"
                                    UniqueName="DeleteColumn" CommandArgument="Child" ConfirmDialogType="RadWindow"
                                    ConfirmText="Are You Sure Want To Delete This Record?" ConfirmTitle="Delete Confirm"
                                    HeaderStyle-Width="10px" />
                                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" FilterControlAltText="Filter DeleteColumn column"
                                    Text="Delete" UniqueName="DeleteColumn" ConfirmDialogType="RadWindow" Resizable="false"
                                    ConfirmText="Delete record?">
                                </telerik:GridButtonColumn>--%>
                            </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>

server side coding

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

                if (dt == null)
                {
                    dt = new DataTable();
                    object[] emptyrow = new object[columcount];
                    dt.Columns.Add("addrestype", typeof(string));
                    dt.Columns.Add("Partype", typeof(string));
                    dt.Columns.Add("Companyname", typeof(string));
                    dt.Columns.Add("Contactperson", typeof(string));
                    dt.Columns.Add("Emailid", typeof(string));
                    dt.Columns.Add("Byemail", typeof(bool));

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

        private void assigndt2(DataTable dt)
        {
            RadTextBox r1;
            CheckBox c1;
            Label l1;


            for (int i = 0; i <= RadGrid1.Items.Count - 1; i++)
            {
                if (dt.Rows.Count - 1 < i)
                {
                    object[] emptyRow = new object[columcount];
                    dt.Rows.Add(emptyRow);
                }
              l1 = (Label)RadGrid1.Items[i].FindControl("addrestype");
                dt.Rows[i]["addrestype"] = l1.Text;
                r1 = (RadTextBox)RadGrid1.Items[i].FindControl("Partype");
                dt.Rows[i]["Partype"] = r1.Text;
                r1 = (RadTextBox)RadGrid1.Items[i].FindControl("Companyname");
                dt.Rows[i]["Companyname"] = r1.Text;
                r1 = (RadTextBox)RadGrid1.Items[i].FindControl("Contactperson");
                dt.Rows[i]["Contactperson"] = r1.Text;
                r1 = (RadTextBox)RadGrid1.Items[i].FindControl("Emailid");
                dt.Rows[i]["Emailid"] = r1.Text;
                c1 = (CheckBox)RadGrid1.Items[i].FindControl("Byemail");
                dt.Rows[i]["Byemail"] = c1.Text;
            }
        }

Thanks & Regards,
Ansari
Eyup
Telerik team
 answered on 20 Sep 2013
3 answers
518 views
Hello!  I have noticed when copying text from MS Word into the RadEditor an opening and closing paragraph tag is being inserted/wrapped around the text.  Is there any way to just remove only the paragraph tag using the 'Formatting Stripper' option in the RadEditor?

I tried the 'Strip Word Formatting' but that has no effect on the HTML tags (as expected).  The 'Strip All Formatting' option will remove the paragraph tags but also removes other formatting that may be desired/necessary such as bolding, italics, etc.

I also tried the 'Paste From Word' button on the RadEditor toolbar, but it has the same effects described above for the 'Format Stripper' button.

I looked through the 'Editing/Cleaning Word Formatting' demo and the 'Cleaning Word Formatting' article but was unable to find a solution related to the paragraph tags.

Thanks!
Marin Bratanov
Telerik team
 answered on 20 Sep 2013
1 answer
332 views
I bind radgrid with large data 12000 rows then  grid display this records with paging
my problem is when i click paging(next page) then error is occured(Not enough storage is available to complete this operation. in javascript (IE8 Browser))
2.firefox browser (Click on next page in RadGrid)

      The connection was reset
      The connection to the server was reset while the page was loading.
      The site could be temporarily unavailable or too busy. Try again in a few
      moments.
     If you are unable to load any pages, check your computer's network
     connection.
    If your computer or network is protected by a firewall or proxy, make sure
    that Firefox is permitted to access the Web.



My Code Is c#
Page load Event()
{
if (ViewState["data"] != null)
            {
                RadGrid1.DataSource = (DataTable)ViewState["data"];
                RadGrid1.DataBind();
            }
}

button1_click()
{
SqlQuery="contain 25 column in select statement"

 DA.Fill(DT);
            RadGrid1.DataSource = DT;
            ViewState["data"] = DT;
            RadGrid1.DataBind();

//12000 rows store in radgrid
}

============================

.aspx

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            </telerik:RadScriptManager>


 <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"
                AllowSorting="True" CellSpacing="0" GridLines="None" PageSize="25"  
                 Height="351px" AllowPaging="True" 
                       >
                <ClientSettings>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    <Resizing ClipCellContentOnResize="False" />
                </ClientSettings>
                <MasterTableView>
                    <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>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <MultiHeaderItemStyle Wrap="false" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>
<telerik:RadButton ID="RadButton1" runat="server" BorderStyle="Solid" OnClick="RadButton1_Click"
            Text="RadButton" UseSubmitBehavior="False">

============================

this is my requirement
please give me proper solution.

thank you in advance.
Nicolaï
Top achievements
Rank 2
 answered on 20 Sep 2013
1 answer
71 views
Hi,

I'm using rad grid and client side data binding. Every time I load the page the grid creates more rows than specified. For example, on the intial load there should be 3 rows loaded. But the grid attempts to create more rows then it goes back to 3 rows. This all happens in a 1 - 2 seconds but you can see the rows than it goes back to normal. If I specify a page size of 2 (which is one less than what I want) everything works fine. If I specify a page size of 3 (which is what I want...3 rows) the grid still attempts to create more rows. I'd really appreciate if anyone can help me make sense of this.

thanks,
Ron.
Marin
Telerik team
 answered on 20 Sep 2013
0 answers
42 views
i want to print out every page in project using   telerik control .
Could i solve this requirement with a print CSS?

thank you very much!
nguyen
Top achievements
Rank 1
 asked on 20 Sep 2013
1 answer
122 views
there was a problem in RadDropDownTree control when i added it in the page
Shinu
Top achievements
Rank 2
 answered on 20 Sep 2013
1 answer
182 views
Hello All,

I am using a grid with batch edit mode and I am unable to find/bind a RadComboBox in an EditItemTemplate. I have tried itemdatabound and prerender and neither seem to work.

Any advice one where it should be bound and how to find it would be greatly appreciated.

Thanks, Paul.

<telerik:GridTemplateColumn HeaderText="Job" HeaderStyle-Width="180px" UniqueName="Job" DataField="jobid">
                            <ItemTemplate>
                                <%# Eval("jobnumber") %>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadComboBox ID="rcbJobID" runat="server" EmptyMessage="Select a Job." CausesValidation="false" Width="90px"
                                    HighlightTemplatedItems="true" DropDownWidth="350px" DataValueField='<%# Eval("jobid") %>'>
                                    <HeaderTemplate>
                                        <table style="width: 320px;" class="dropdownheader">
                                            <tr>
                                                <td style="width: 150px;">Job #
                                                </td>
                                                <td style="width: 170px">Job Name
                                                </td>
                                            </tr>
                                        </table>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <table style="width: 320px;">
                                            <tr>
                                                <td style="width: 150px">
                                                    <%# DataBinder.Eval(Container, "Text")%>
                                                </td>
                                                <td style="width: 170px; text-align: left;">
                                                    <%# DataBinder.Eval(Container, "Attributes['Description']")%>
                                                </td>
                                            </tr>
                                        </table>
                                    </ItemTemplate>
                                </telerik:RadComboBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>

Angel Petrov
Telerik team
 answered on 20 Sep 2013
1 answer
91 views



In my application, I  have main menu like tree view which is in expand and collapse panel. rad combobox is disturbed when collapse or expand the treview panel. pls find the attachment.



Plz help me .
Angel Petrov
Telerik team
 answered on 20 Sep 2013
1 answer
164 views
hello all, 
I have 2 textbox as shown in code below : 


<telerik:GridTemplateColumn UniqueName="guarantyAmount" HeaderText="<%$Resources:Strings,amount  %>">
                    <ItemTemplate>
                        <asp:Label Text='<%# Eval("WARRANTY_AMOUNT")%>' runat="server" id="warrantyAmountText">
                            </asp:Label>
                    </ItemTemplate>
                   <EditItemTemplate>
                
                       <telerik:RadNumericTextBox runat="server" id="warrantyAmount" ClientEvents-OnValueChanging="warrantyAmount_ValueChanging"></telerik:RadNumericTextBox>
                        </EditItemTemplate>
                   </telerik:GridTemplateColumn>
                 
                  <%--<telerik:GridBoundColumn DataField="REAL_VALUE" HeaderText='<%$Resources:Strings,realValue %>' UniqueName="guarantyRealValue"/>--%>
              <telerik:GridTemplateColumn UniqueName="guarantyRealValue" HeaderText="<%$Resources:Strings,realValue  %>">
                    <ItemTemplate>
                        <asp:Label Text='<%# Eval("REAL_VALUE")%>' runat="server" id="realValueText">
                            </asp:Label>
                    </ItemTemplate>
                   <EditItemTemplate>
                
                       <telerik:RadNumericTextBox runat="server" id="realValue"></telerik:RadNumericTextBox>
                        </EditItemTemplate>
                   </telerik:GridTemplateColumn>


what i want is to create  " warrantyAmount_ValueChanging " js function that read input value from "warrantyAmount " textbox and put them in "realValue" ..

how can i achieve that ??


Angel Petrov
Telerik team
 answered on 20 Sep 2013
7 answers
614 views

Hi,

I am doing booking form page for the members with Radcaptch validation.

 

<telerik:RadCaptcha ID="RadCaptcha1" runat="server" ValidationGroup="SubmitInfo"

 

 

   ErrorMessage="The code you entered is not valid." Display="Dynamic">

 

 

</telerik:RadCaptcha>

 


I given the ValidationGroup Property to textbox requiredfield validation and  submit button also.

RequiredFieldValidator is validating for textbox but radcaptch is not validating

 

<asp:TextBox ID="txtemail" runat="server"></asp:TextBox>

 

 

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="SubmitInfo"

 

 

runat="server" ControlToValidate="txtemail" ErrorMessage="Enter Email"></asp:RequiredFieldValidator>

 



 

<asp:Button ID="btnbooking" runat="server" ValidationGroup="SubmitInfo" Text="Submit"

 

 

OnClick="btnbooking_Click" />


Please help in the issue which i stucked for 3 days.

Urgent reply highly appreciable

Regards,
Prathap Narravula



 

Dhamodharan
Top achievements
Rank 1
 answered on 20 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?