Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
162 views
Hi Everyone,

I have a usercontrol used to edit values in a radgrid, so standard code, user clicks row in grid, grid expands to display the usercontrol containing all the values for the various fields in the row.

Something I have noticed is that with IE9 compatibility the RadCombobox does not respond to clicking on the down arrow unless you first give the Radcombobox the focus by clicking in the text area which results in the dropdown being displayed and the RadCombobox getting the focus, thereafter the dropdown arrow will respond to mouse clicks until the radCombobox loses the focus.

The strange thing is that this only seems to be a problem in some of the usercontrols displayed by various grids in our application.
I have turned off our custom skin and used one of the standard skins which didn't make a difference.
Even more strange is that on one particular usercontrol there is also 2 RadNumericTextboxes which dissappear as soon as any of the other controls on the usercontrol get the focus.

Has anyone come across this before?

Thanks
Antony
Ivana
Telerik team
 answered on 12 Oct 2012
1 answer
360 views
Dear all,
I have an asp.net webapp (4.0) using the RadGrid. It works as expected. But after deploying to live system, the filter does not work anymore. On our live system we have a Web Application Firewall (WAF) which checks for some security problems. One rule (set up by our Headquarter) is to deny values like semi-colon and "and" in the same line, e.g. a filter like " a; and b" results in a denial message from the WAF. As said, it's setup by Headquarter so I could not discuss that.
Now I have the problem that even a filter like "a and b" would not work. It's still denied for security reasons. I've checked the post and saw that "__EVENTARGUMENT" contained "FireCommand:ctl00$MainContent$MyGrid$ctl00;Filter;Subject|a and b|Contains". So here we have again semicolon and "and". Probably that's the reason for the denial.
Is there any way to get the semi-colons removed or replaced in the __EVENTARGUMENT?
Thanks!
Antonio Stoilkov
Telerik team
 answered on 12 Oct 2012
2 answers
138 views

I have a multi-column comboBox which allows custom text and has "EnableLoadOnDemand" set to true. I want to populate the columns (4 in total) with a list of search results, based on an active directory search method (which returns UserID, Name, Email, Line Manager)

At present, the method works great when the user enters a surname into the text property and clicks a "Search" button (the method is assigned to the OnClick event of the button, obviously.)

What I would like to happen is for the user to enter the first few letters of a surname and the multi-column combobox will load the results on demand.

The results do not come from a datasource, as explained above.

Would this behaviour be possible at all?

As a framework, I have similar code structure to the example found here

Thanks.

 Markup:

<telerik:RadComboBox ID="UserIDComboBox" runat="server" AllowCustomText="True" DropDownWidth="400px" MarkFirstMatch="True" EnableLoadOnDemand="true" OnItemsRequested="UserID_ItemsRequested" OnItemDataBound="UserID_ItemsDataBound"
                  ToolTip="Type first 3 letters of Surname and click Search." Width="200px">
                  <HeaderTemplate>
                      <ul>
                          <li class="col1">User_ID</li>
                          <li class="col2">Name</li>
                          <li class="col3">Email</li>
                          <li class="col4">Line Manager</li>
                      </ul>
                  </HeaderTemplate>
                  <ItemTemplate>
                      <ul>
                      <li class="col1">
                      <%# DataBinder.Eval(Container.DataItem, "UserId") %>
                      </li>
                      <li class="col2">
                      <%# DataBinder.Eval(Container.DataItem, "Name")%>
                      </li>
                      <li class="col3">
                      <%# DataBinder.Eval(Container.DataItem, "Email") %>
                      </li>
                      <li class="col4">
                      <%# DataBinder.Eval(Container.DataItem, "Line Manager") %>
                      </li>
                      </ul>
                  </ItemTemplate>
              </telerik:RadComboBox>

C#

protected void UserID_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            List<User> searchResults = null;
 
            //AD Search (uncomment to test)
            ADSearch ads = new ADSearch();
            searchResults = ads.SearchAD(UserIDComboBox.Text, UserName, Password);
 
            if (null == searchResults)
            {
                UserIDComboBox.Text = "No User Found";
 
            }
            else
            {
                foreach (User adu in searchResults)
                {
                    "UserID field" = adu.UserId;
                    "Name field" = adu.Name;
                    "Email field" = adu.Email;
                   "Manager field" = adu.Manager;
                 }
            }
        }
        protected void UserID_ItemsDataBound(object sender, RadComboBoxItemEventArgs e)
        {
            e.Item.Text = ((DataRowView)e.Item.DataItem)["UserId"].ToString();
            e.Item.Text = ((DataRowView)e.Item.DataItem)["Name"].ToString();
            e.Item.Text = ((DataRowView)e.Item.DataItem)["Email"].ToString();
            e.Item.Text = ((DataRowView)e.Item.DataItem)["Manager"].ToString();
        }
Dimitar Terziev
Telerik team
 answered on 12 Oct 2012
3 answers
150 views
Hi

I am trying to create a custom insert template.
When a user adds an appointment they assign it to other users and I am trying to add the ability to narrow down the users via dropdowns within the template.
I have two dropdowns, Organisation and Section, organisation posts back to populate the sections, then when a section is selected it populates a users checkboxlist based on the results.


In the AdvancedControlsPanel I have the following:
<asp:Panel runat="server" ID="AdvancedControlsPanel" CssClass="rsAdvMoreControls">
                        <label>
                            Type:
                        </label>
                        <!--
-->
                 <asp:Panel runat="server" ID="pnlUsers">
                            <label>
                                Users:</label><br />
                            Search for users
                            <asp:DropDownList ID="ddlOrganisation" runat="server" OnSelectedIndexChanged="ddlOrganisation_SelectedIndexChanged"
                                AutoPostBack="true">
                            </asp:DropDownList>
                            Sections
                            <asp:DropDownList ID="ddlSections" runat="server" OnSelectedIndexChanged="ddlSections_SelectedIndexChanged"
                                AutoPostBack="true">
                            </asp:DropDownList>
                            <asp:CheckBoxList runat="server" ID="chkUsers">
                            </asp:CheckBoxList>
                        </asp:Panel>
                        <asp:Panel runat="server" ID="ResourceControls">
                        </asp:Panel>
                    </asp:Panel>


When the postback happend all the rest of the controls in the insert window blanked so I tried putting these in an ajaxpanel and registering it with the scriptmanager as it was saying it needed registering when the dropdown did the autopostback.
I did this on the advanced form page load like so 
sm1.RegisterScriptControl(ajaxpnl);

but I got an error saying
script controls may not be registered before PreRender


I also tried using a ajaxmanager proxy against the dropdowns but this just seemed to replicate the controls down the page.

My main page has a RadAJaxManager on it and the radscheduler is ajaxified.

Is there any examples anywhere of how I can get this to work?
I know its a problem with my ajax but I can't get my head round it! 

Bex



Steve
Top achievements
Rank 1
 answered on 12 Oct 2012
2 answers
117 views
Hi,

is there any way by which I can specify Header & Footer for a Rad Editor. If this is not supported is there any workaround by which I can achieve this?

Thanks for the support.
Navnit
Top achievements
Rank 1
 answered on 12 Oct 2012
3 answers
124 views
Hi,

I am insering html from a drop downlist to RadEditor.Here dropdown 's  selecte item value  is going add to the editor.
When paste html the cursor remains at starting position of the string i have pasted, but actually the cursor should appear at the end of the
string.
This is working fine in IE not in any other browser.
Any soution to move cursor at the end of  string pasted?
observe the image i have attached ,where the cursor displaying at the starting position of pasted string.
Here is my code,

function getSelectedItemValue(combobox, args)
 {                                       
  var value = combobox.get_value();                                      
  var editor = $find("<%=RadEditor1.ClientID%>");
  editor.pasteHtml(value);                                     

   }


Rumen
Telerik team
 answered on 12 Oct 2012
4 answers
292 views
Hi There

I am using RadListBox as Checkbox='true'. I have about 6 RadListBoxItem.
If I check the 5th or the 6th item in the checkbox, I want rest all the other items to get unchecked(if checked) and disabled.
I tried using events 'ItemCheck' and 'SelectedIndexChanged' but events does not fire. My AutoPostback is set to true.
I am using RadControls for ASP.NET AJAX Q3 2009.
Please let me know the solution as I am fighting with this problem since long.

Thanks
Nupur Yaduka
Bozhidar
Telerik team
 answered on 12 Oct 2012
1 answer
193 views
I am trying to assign the datasource from a DataTable.  The data table gets filled from the DB, but nothing shows up on the radgrid, not even column names.  



protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            LoadGrid1();
        }
private
void LoadGrid1()
        {
            string sql = GetSQL();
            DB2Connection connection = new DB2Connection(WebConfigurationManager.ConnectionStrings["TX"].ConnectionString);
            DB2DataAdapter dataAdapter = new DB2DataAdapter(sql, connection);
            DataTable dataTable = new DataTable();
            using (connection)
            {
                dataAdapter.Fill(dataTable);
            }
            RadGrid1.DataSource = dataTable;
        }
<telerik:RadGrid
                ID="RadGrid1"
                runat="server"
                AllowPaging="true"
                AllowFilteringByColumn="true"
                AutoGenerateColumns="false"
                PageSize="20"
                OnNeedDataSource="RadGrid1_NeedDataSource"
                OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">
            <MasterTableView DataKeyNames="invoice_id">
                <Columns>
                    <telerik:GridButtonColumn
                        Text="Details"
                        CommandName="Select" />
                    <telerik:GridBoundColumn 
                        DataField="invoice_id"
                        HeaderText="Invoice ID" />
                    <telerik:GridBoundColumn 
                        DataField="x12_id"
                        HeaderText="X12 ID" />
                    <telerik:GridBoundColumn 
                        DataField="st_id"
                        HeaderText="ST ID" />
                    <telerik:GridBoundColumn 
                        DataField="invoice_num"
                        HeaderText="Invoice #" />
                    <telerik:GridBoundColumn 
                        DataField="invoice_dt"
                        HeaderText="Invoice Date"
                        DataFormatString = "{0:MM/dd/yyyy}" />
                    <telerik:GridBoundColumn 
                        DataField="po_num"
                        HeaderText="PO #" />
                    <telerik:GridBoundColumn 
                        DataField="po_dt"
                        HeaderText="PO Date"
                        DataFormatString = "{0:MM/dd/yyyy}" /> 
                    <telerik:GridBoundColumn 
                        DataField="vendor_id"
                        HeaderText="Vendor ID" /> 
                    <telerik:GridBoundColumn 
                        DataField="vendor_duns"
                        HeaderText="Vendor DUNS #" />
                    <telerik:GridBoundColumn 
                        DataField="user_flg1"
                        HeaderText="Type" />
                    <telerik:GridBoundColumn 
                        DataField="user_flg2"
                        HeaderText="EDI Type" />
                    <telerik:GridBoundColumn 
                        DataField="total_amt"
                        HeaderText="Amount" />
                    <telerik:GridBoundColumn 
                        DataField="num_lines"
                        HeaderText="Lines" /> 
                    <telerik:GridBoundColumn 
                        DataField="store_num"
                        HeaderText="Store #" />            
                </Columns>
            </MasterTableView>
            <ClientSettings EnableRowHoverStyle="true" />
        </telerik:RadGrid>
Andrey
Telerik team
 answered on 12 Oct 2012
5 answers
271 views
I have a radgrid that is being dynamically created, adding 1 row at a time.   One of the columns is a radcombobox which is filled using LINQ.  The prerender event is set for the grid to make all rows editable (for multirowedit functionality).  All of that works fine...the problem is that each time I add a new row to the grid the selectedvalue of the radcombobox for previously entered rows changes to match the selectedvalue for the new row.  How do i get each combobox in each row to retain its correct selectedvalue?  To clarify...the selection of each radcombobox is set using: rcb.Text = "SelectedValueText" where "SelectedValueText" is a value which appears in the radcombobox.  I'm thinking the issue has to do with the prerender event calling rebind which executes itemdatabound for each row in the grid but i'm not sure how to make all columns in a row editable on the row level (as each row is added) as opposed to on the gridlevel.  Can you iterate through the cells in a single row to put in edit mode from within the ItemDataBound event?

Code: VB
    Private Sub rgDataEntry_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgDataEntry.ItemDataBound
        If (Session("DataEntry") Is Nothing) Then
            CreateDataTable()
        End If

        If (TypeOf e.Item Is GridEditableItem And e.Item.IsInEditMode) Then
            Dim item As GridEditableItem = CType(e.Item, GridEditableItem)
            Dim rcb As RadComboBox = CType(item.FindControl("cboFundingCodeEdit"), RadComboBox)
            Dim db As EcotAppsDataContext = New EcotAppsDataContext

            Dim query = From codes In db.FundingCodes
                        Select codes.FundingCode, codes.FundingCodeID Order By FundingCode Order By FundingCode

            For Each x In query
                Dim rcbItem As New RadComboBoxItem(x.FundingCode.ToString)
                rcb.Items.Add(rcbItem)
            Next

            Dim rcbDefaultItem As New RadComboBoxItem(String.Empty)
            rcb.Items.Insert(0, rcbDefaultItem)

            Dim FundCode As String
            FundCode = Convert.ToString(Session("FundingCode"))
            rcb.Text = FundCode

        End If

    End Sub

    Private Sub rgDataEntry_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles rgDataEntry.PreRender
        If (Session("DataEntry") Is Nothing) Then
            CreateDataTable()
        End If

        For Each item As GridItem In rgDataEntry.MasterTableView.Items
            If TypeOf item Is GridEditableItem Then
                Dim editableItem As GridEditableItem = CType(item, GridDataItem)
                editableItem.Edit = True
            End If
        Next
        rgDataEntry.Rebind()

    End Sub
Radoslav
Telerik team
 answered on 12 Oct 2012
0 answers
247 views
Hi,
I have developed a web site where I have used Telerik Grid .I enabled Filtering for Grid columns.When my Security team ran test with Acunetix Vulnerability Scanner,Filter Text box for a Text column is identified as Vulnerable to SQL Injection.Please advise a solution for this.

Thanks Himagiri
Himagiri
Top achievements
Rank 1
 asked on 12 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?