Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
104 views
Hello everyone,

I'm currently trying to use RadControls in my Sharepoint WebPart. One of it is the ComboBox control.
I wanted to know, how I can bind my ComboBox with multiple columns to a SPDataSource.

I already accomplished to bind the first comlumn, but I don't know how to bind the others.

First I have my HeaderTemplate here:

Class HeaderTemplate
    Implements ITemplate

    Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
        Dim table As New HtmlTable()
        Dim row As New HtmlTableRow()
        Dim cell As New HtmlTableCell()

        table.Width = "100%"

        cell.InnerHtml = "<font size='1pt'><b>Projekt Nr.</b></font>"
        cell.Width = "30%"
        row.Controls.Add(cell)

        Dim cell1 As New HtmlTableCell()

        cell1.InnerHtml = "<font size='1pt'><b>Projekt Name</b></font>"
        cell1.Width = "70%"
        row.Controls.Add(cell1)

        table.Controls.Add(row)

        container.Controls.Add(table)
    End Sub
End Class

And here I bind data:

Dim ds As New SPDataSource
ds.DataSourceMode = SPDataSourceMode.List
ds.List = web.Lists("Projekte")
ds.UseInternalName = True

projekt = New RadComboBox
projekt.ID = "cmb_projekt"
projekt.Width = 300
projekt.Skin = "WebBlue"

projekt.HeaderTemplate = New HeaderTemplate()

projekt.DataSource = ds
projekt.DataTextField = "Nr"
projekt.DataBind()

Thanks for all replies.

Best regards,

Mark

Kalina
Telerik team
 answered on 21 Jan 2010
1 answer
113 views
Is it possible to have a conditional mask?  As in, zip code (5 digit) would be #####.  But if they kept entering numbers (up to 4 more) it would be ##### - ####.

Is this possible?
Shinu
Top achievements
Rank 2
 answered on 21 Jan 2010
3 answers
91 views
Are there any future plans to make some of the other controls work within a MVC environment?  (RadSplitter, RadEditor, RadSlider, etc.)?  While there may be limits to what can be done, any thoughts on moving in this direction so that the controls will work somewhat in either environment (WebForms or MVC)?

Thanks in advance.

Atanas Korchev
Telerik team
 answered on 21 Jan 2010
1 answer
129 views
I often use combo boxes in RadGrids and have no issues with these at all. In one of my forms I need to let the user select a client name from a drop-down. The combo box needs to display over 3000 names. This isn't really practical for a website. The page takes FOREVER to allow selection and update.

I got this to work much faster by putting in a link button that opens another form which allows a search, a grid to show search results, and then upon selection sets a session variable that is used by the originating edit mode of the grid. An update or insertion takes this selection and adds it to the database. This works, is infinitely faster for the end user, but doesn't show me in edit mode who they've selected.

I attached a screen dump of the edit mode form to show what I'm discussing. If I place a combo box bound to all Members, then the form is way too slow to use. If I use this link button to open an external search and select option, performance is great, but the user has no idea of who they selected.

What would you recommend for a solution?  Is there a way to make the combo box perform fast with this amount of records being bound, or is there a way to use a label or something within edit mode to make this display the selected person?
Pavlina
Telerik team
 answered on 21 Jan 2010
1 answer
299 views
Hello,

Just to inform you on a error I got. I can work around it by ommiting the culprit symbols from the CaptchaImage-CharSet.

But I got this error with the following setup:

<telerik:RadCaptcha ID="RadCaptcha1" Runat="server" EnableRefreshImage="true"   
                                CaptchaTextBoxLabel="<br />neem de code over."   
                                CaptchaLinkButtonText="Genereer nieuwe code" 
                                CaptchaImage-TextChars="CustomCharSet"   
                                CaptchaImage-CharSet="ABCDEFGHIJKLMNPQRSTUVWXY@#%&"   
                                Display="Dynamic"   
                                ProtectionMode="Captcha"   
                                RegisterWithScriptManager="true"   
                                ErrorMessage="Foute code"   
                                ValidationGroup="submitGroup"  > 
                        </telerik:RadCaptcha> 

At a certain point the code was: JP&#D and that generated the below error:

Server Error in '/PWeb' Application.
--------------------------------------------------------------------------------

A potentially dangerous Request.Form value was detected from the client (RadCaptcha1$CaptchaTextBox="JP&#D").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (RadCaptcha1$CaptchaTextBox="JP&#D").

Pero
Telerik team
 answered on 21 Jan 2010
1 answer
118 views
Hello,

I make some tests to identify the cause of jerky scrolling with the RadGrid on my WebPage and I found it :
I have a RadTabStrip control on the same page and when I remove this control, the RadGrid scrolling works like a charme!

Is it possible that these both controls are in conflict? I encoured this issue on two pages of my WebSite and this is caused by the presence of the RadTabStrip control.

Thank you for your help.

Joël
Dimo
Telerik team
 answered on 21 Jan 2010
3 answers
288 views
Hi Team,

the first issue i am facing is how do i add the RadDateTimePicker dynamically from the code behind. I tried putting the control using the following piece of snippet.
 cntrlType = webControls.GetType("Telerik.Web.UI.RadDateTimePicker");
                            objCntrl = Activator.CreateInstance(cntrlType);
                            ((Telerik.Web.UI.RadDateTimePicker)objCntrl).ID="datetimePicker";
                            this.Controls.Add((Telerik.Web.UI.RadDateTimePicker)objCntrl);
after adding this from the code behind it is displaying the date and time button, however on clik of those button no go.
Kindly help us.

thanks,
jayakumar chinnappa



Martin
Telerik team
 answered on 21 Jan 2010
1 answer
134 views

<

 

telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"

 

 

 

 

 

AllowMultiRowEdit="false" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"

 

 

 

 

 

EnableEmbeddedSkins="false" GridLines="None" MasterTableView-EditMode="InPlace"

 

 

 

 

 

OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound"

 

 

 

 

 

OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender" OnUpdateCommand="RadGrid1_UpdateCommand"

 

 

 

 

 

PageSize="20" ShowStatusBar="True" Skin="Custom">

 

 

 

 

 

<MasterTableView AutoGenerateColumns="false" ClientDataKeyNames="PROPID" CommandItemDisplay="TopAndBottom" NoMasterRecordsText="No Data Available"

 

 

 

 

 

CommandItemStyle-HorizontalAlign="Right" DataKeyNames="PROPID" EditMode="InPlace"

 

 

 

 

 

ItemStyle-Height="20px" >

 

 

 

 

 

<Columns>

 

 

 

 

 

<telerik:GridTemplateColumn DataField="AppId" Display="false" HeaderText="AppId"

 

 

 

 

 

UniqueName="AppId">

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<asp:Label ID="lblAppId" runat="server" Text='<%# Bind( "AppId" ) %>'></asp:Label>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

<EditItemTemplate>

 

 

 

 

 

<asp:Label ID="lblAppIdEdit" runat="server" Text='<%# Bind( "AppId" ) %>'></asp:Label>

 

 

 

 

 

</EditItemTemplate>

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

<telerik:GridTemplateColumn DataField="PROPID" Display="false" HeaderText="PROPID"

 

 

 

 

 

UniqueName="PROPID">

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<asp:Label ID="lblPROPID" runat="server" Text='<%# Bind( "PROPID" ) %>'></asp:Label>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

<EditItemTemplate>

 

 

 

 

 

<asp:Label ID="lblPROPIDEdit" runat="server" Text='<%# Bind( "PROPID" ) %>'></asp:Label>

 

 

 

 

 

</EditItemTemplate>

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

<telerik:GridBoundColumn DataField="PropertyType" HeaderText="Category" ReadOnly="true"

 

 

 

 

 

UniqueName="PropertyType">

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn DataField="PropertyName" HeaderText="Property Name" ReadOnly="true"

 

 

 

 

 

UniqueName="PropertyName">

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridTemplateColumn DataField="PropertyValue" HeaderText="Property Value"

 

 

 

 

 

UniqueName="PropertyValue">

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<asp:Label ID="lblPropertyValue" runat="server" Text='<%# Bind( "PropertyValue" ) %>'>

 

 

 

 

 

</asp:Label>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

<EditItemTemplate>

 

 

 

 

 

<asp:DropDownList ID="ddlList" runat="server">

 

 

 

 

 

</asp:DropDownList>

 

 

 

 

 

<asp:TextBox ID="txtPropertyValue" runat="server" CssClass="adminUser_textInput1" Text='<%# Bind( "PropertyValue" ) %>' MaxLength='<%# Bind( "PropertyMax" ) %>' ></asp:TextBox>

 

 

 

 

 

<telerik:RadColorPicker ID="cpColorProperty" runat="server" ShowIcon="true" ShowEmptyColor="false" OnClientColorChange="HandleColorChange" Height="350" Width="350"></telerik:RadColorPicker>

 

 

 

 

 

<span id = "SpanMandatory" runat="server" style="color: Red"> *</span>

 

 

 

 

 

<br/>

 

 

 

 

 

</EditItemTemplate>

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

<telerik:GridBoundColumn DataField="PropertyDefaultValue" HeaderText="Default Value"

 

 

 

 

 

ReadOnly="true" UniqueName="PropertyDefaultValue">

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridTemplateColumn HeaderText="Property Description" UniqueName="PropertyDescription">

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<asp:Label ID="lblPropertyDescription" runat="server" Text='<%# Bind( "PropertyDescription" ) %>'/>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="../../Skins/Custom/Grid/Cancel.gif"

 

 

 

 

 

EditImageUrl="../../Skins/Custom/Grid/Edit.gif" HeaderStyle-CssClass="header_grid"

 

 

 

 

 

HeaderText="Action" InsertImageUrl="../../Skins/Custom/Grid/AddRecord.gif" UniqueName="EditCommandColumn"

 

 

 

 

 

UpdateImageUrl="../../Skins/Custom/Grid/Update.gif">

 

 

 

 

 

<ItemStyle CssClass="grid" Width="3%" />

 

 

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

 

 

</Columns>

 

 

 

 

 

<PagerTemplate>

 

 

 

 

 

<div>

 

 

 

 

 

<table border="0" cellpadding="0" cellspacing="0" width="100%">

 

 

 

 

 

<tr>

 

 

 

 

 

<td>

 

 

 

 

 

<asp:Panel ID="PagerPanel" runat="server" BorderStyle="None" BorderWidth="0">

 

 

 

 

 

<table border="0" cellpadding="0" cellspacing="0" width="100%">

 

 

 

 

 

<tr>

 

 

 

 

 

<td width="30%">

 

 

 

 

 

<img alt="" src="/images/spacer.gif" width="12" /></td>

 

 

 

 

 

<td width="70%">

 

 

 

 

 

<table border="0" cellpadding="0" cellspacing="6" class="site_setting_table">

 

 

 

 

 

<tr>

 

 

 

 

 

<td height="20" width="20">

 

 

 

 

 

<asp:Button ID="btnChangeToFirst" runat="server" CommandArgument="First" CommandName="Page"

 

 

 

 

 

CssClass="data_preView_but3" Height="20" OnClientClick="changePage('first'); return false;"

 

 

 

 

 

ToolTip="First" Width="20" />

 

 

 

 

 

</td>

 

 

 

 

 

<td height="20" width="20">

 

 

 

 

 

<asp:Button ID="btnChangeToPrev" runat="server" CssClass="data_preView_but1" Height="20"

 

 

 

 

 

OnClientClick="changePage('prev'); return false;" ToolTip="Previous" Width="20" />

 

 

 

 

 

</td>

 

 

 

 

 

<td>

 

 

 

 

 

<table border="1" cellpadding="0" cellspacing="0" class="site_setting_table">

 

 

 

 

 

<tr>

 

 

 

 

 

<td class="admin_label4">

 

 

 

 

Page:

</td>

 

 

 

 

 

<td class="admin_label4">

 

 

 

 

 

<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Height="19" Skin="Office2007"

 

 

 

 

 

Value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>'

 

 

 

 

 

Width="25px">

 

 

 

 

 

<NumberFormat DecimalDigits="0" />

 

 

 

 

 

</telerik:RadNumericTextBox></td>

 

 

 

 

 

<td class="admin_label4">

 

 

 

 

of

<%

# DataBinder.Eval(Container, "Paging.PageCount")%>

 

 

<!-- Cybage- -->

 

 

 

 

 

 

<!-- Cybage- -->

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

</table>

 

 

 

 

 

</td>

 

 

 

 

 

<td height="20" width="20">

 

 

 

 

 

<asp:Button ID="btnChangetoNext" runat="server" CommandArgument="Next" CommandName="Page"

 

 

 

 

 

CssClass="data_preView_but2" Height="20" OnClientClick="changePage('next'); return false;"

 

 

 

 

 

ToolTip="Next" Width="20" />

 

 

 

 

 

</td>

 

 

 

 

 

<td height="20" width="20">

 

 

 

 

 

<asp:Button ID="btnChangeToLast" runat="server" CommandArgument="Last" CommandName="Page"

 

 

 

 

 

CssClass="data_preView_but4" Height="20" OnClientClick="changePage('last'); return false;"

 

 

 

 

 

ToolTip="Last" Width="20" />

 

 

 

 

 

<asp:Panel ID="NumericPagerPlaceHolder" runat="server">

 

 

 

 

 

</asp:Panel>

 

 

 

 

 

</td>

 

 

 

 

 

<!-- Cybage- -->

 

 

 

 

 

<td class="admin_label4">

 

 

 

 

 

<table>

 

 

 

 

 

<tr>

 

 

 

 

 

<td class="admin_label4">

 

 

 

 

Records per page:

&nbsp;</td>

 

 

 

 

 

<td>

 

 

 

 

 

<asp:DropDownList ID="ddlpagesize" runat="server" AutoPostBack="true" CssClass="admin_list2"

 

 

 

 

 

OnSelectedIndexChanged="ddlpagesize_OnSelectedIndexChange">

 

 

 

 

 

<asp:ListItem Text="15" Value="15"></asp:ListItem>

 

 

 

 

 

<asp:ListItem Text="20" Value="20"></asp:ListItem>

 

 

 

 

 

<asp:ListItem Text="25" Value="25"></asp:ListItem>

 

 

 

 

 

<asp:ListItem Text="30" Value="30"></asp:ListItem>

 

 

 

 

 

</asp:DropDownList>

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

</table>

 

 

 

 

 

</td>

 

 

 

 

 

<!-- Cybage- -->

 

 

 

 

 

</tr>

 

 

 

 

 

</table>

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

</table>

 

 

 

 

 

</asp:Panel>

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

</table>

 

 

 

 

 

</div>

 

 

 

 

 

</PagerTemplate>

 

 

 

 

 

<PagerStyle Mode="NumericPages" PageButtonCount="10" />

 

 

 

 

 

<CommandItemTemplate>

 

 

 

 

<%

--<asp:Button ID="UpdateBtn" runat="server" CausesValidation="False" CommandName="UpdateAll"

 

CssClass="button" Text="Update" ToolTip="Update" />--

 

%>

 

 

</CommandItemTemplate>

 

 

 

 

 

</MasterTableView>

 

 

 

 

<%

--------Cybage-04-Feb-2009----------------------------------------------------------------------------------------%>

 

 

<ClientSettings>

 

 

 

 

 

<ClientEvents OnGridCreated="GridCreated" OnRowClick="RowClick" OnRowDblClick="RowDblClick" />

 

 

 

 

 

</ClientSettings>

 

 

 

 

<%

--------Cybage-04-Feb-2009----------------------------------------------------------------------------------------%>

 

 

<EditItemStyle CssClass="EditRow_WinXP" />

 

 

 

 

 

</telerik:RadGrid>

 




I have used Color Picker in above mentioned code with Default Skin. When ever any row with Color Picker trys to edit, it distorted the UI(See Attached jif image). It is happening in all browsers. Can you please help me in this?
Tsvetie
Telerik team
 answered on 21 Jan 2010
2 answers
92 views
How do we remove space or color next to the child category??
Sleven
Top achievements
Rank 1
 answered on 21 Jan 2010
1 answer
232 views
Hi,
 I have written some code to trigger the  filtering on one button, however when I click this button the values in the filter textboxes dissappear because a postback has taken place. How do I retain the values in the filtering textboxes after posting back.

Thanks
Robert Smith

    protected void Filter()
        {
            string expression = string.Empty;
            string textFilter = string.Empty;
            string colName = string.Empty;
          
            if (this.AllowFilteringByColumn)
            {

                GridFilteringItem item = MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
               
              
                for (int i = 0; i < Columns.Count; i++)
                {

                    Type colType = Columns[i].DataType;
                    Telerik.Web.UI.GridColumn column = Columns[i];

                    
                    colName = MasterTableView.Columns[i].UniqueName;
                    string dataField = "";

                  
                    if (item[colName].Controls.Count <= 0)
                        continue;

                    
                    string GridColumnType = (MasterTableView.Columns[i].Owner).Columns.FindByUniqueName(colName).GetType().Name;
                    if (GridColumnType == "GridTemplateColumn")
                    {

                        GridTemplateColumn MyColumn = (GridTemplateColumn)(MasterTableView.Columns[i].Owner).Columns.FindByUniqueName(colName);
                        dataField = MyColumn.DataField;

                    }else if (GridColumnType == "GridBoundColumn" )
                    {
                        GridBoundColumn MyColumn = (GridBoundColumn)(MasterTableView.Columns[i].Owner).Columns.FindByUniqueName(colName);
                        dataField = MyColumn.DataField;
                    }
                    else if (GridColumnType == "GridCheckBoxColumn")
                    {

                        GridCheckBoxColumn MyColumn = (GridCheckBoxColumn)(MasterTableView.Columns[i].Owner).Columns.FindByUniqueName(colName);
                        dataField = MyColumn.DataField;

                    }
                 
                     if ((item[colName].Controls.Count > 2))
                    {
                        if (item[colName].Controls[1].GetType().Name == "RadComboBox")
                        {
                            textFilter = (item[colName].Controls[1] as RadComboBox).SelectedValue;
                            if (textFilter == "ALL" || textFilter == "")
                            {
                                continue;

                            }
                            else
                            {
                                if (expression != "")
                                    expression += " AND ";
                                GridDropDownColumn MyColumn = (GridDropDownColumn)(MasterTableView.Columns[i].Owner).Columns.FindByUniqueName(colName);
                                dataField = MyColumn.DataField;
                                expression += "([" + dataField + "] = " + textFilter + ")";
                                continue;

                            }

                        }
                        else
                        {
                            //at this stage we don't know what type of control it is and thus can't handle it
                            continue;

                        }

                    }


                    if (colType == typeof(System.String) && (Columns[i].Visible))
                    {

                         textFilter = (item[colName].Controls[0] as TextBox).Text;


                        if (textFilter != "")
                        {
                            if (expression != "")
                                expression += " AND ";
                            expression += "([" + dataField + "] LIKE \'%" + textFilter + "%\')";
                           
                        }
                    }

                    if ((colType == typeof(System.Int32) || colType == typeof(System.Double))&& (Columns[i].Visible))
                    {

                      
                         textFilter = (item[colName].Controls[0] as TextBox).Text;

                        if (textFilter != "")
                        {
                            if (expression != "")
                                expression += " AND ";

                            expression += "([" + dataField + "] = " + textFilter + ")";
                         
                        }

                    }

                    if (colType == typeof(System.DateTime) && (Columns[i].Visible))
                    {


                         DateTime dtFilter;
                        if ((item[colName].Controls[0] as TextBox).Text != "")
                        {
 
                          dtFilter =  Convert.ToDateTime((item[colName].Controls[0] as TextBox).Text);
                        }else
                        {
                            continue;
                        }

                        if (textFilter != null)
                        {
                            if (expression != "")
                                expression += " AND ";

                            expression += "([" + dataField + "] = \'" + dtFilter + "\')";

                        }

                        this.FilterValues[colName] = dtFilter;
                    }



                    if (colType == typeof(System.Boolean) && (Columns[i].Visible))
                    {


                        bool boolFilter = (item[colName].Controls[0] as CheckBox).Checked;

                        if (boolFilter  != false)
                        {
                            if (expression != "")
                                expression += " AND ";

                            expression += "([" + dataField + "] = " + boolFilter + ")";
                        }

                        this.FilterValues[colName] = boolFilter;
                    }

                    if (textFilter != string.Empty)
                    {
                        this.FilterValues[colName] = textFilter;
                    }

                }

             
            }
            this.MasterTableView.FilterExpression = expression;
            this.MasterTableView.Rebind();

            // Loop over the list, writing out the value

            foreach (DictionaryEntry myEntry in FilterValues)
            {
                this.Columns.FindByUniqueName(Convert.ToString(myEntry.Key)).CurrentFilterValue = Convert.ToString(myEntry.Value);

                Console.WriteLine(myEntry.Value);

            }

          
        }



Radoslav
Telerik team
 answered on 21 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?