Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
124 views
Hello and Thank you for your help in advance,

I am facing an issue where I have two rad windows, and each rad window contains a radcombobox.
These rad windows are opened on the client and are basically just two small forms.
There are submit buttons in each rad window which provide a post back and a stored procedure call.
The problem I am seeing is that it takes a page refresh from browser two these the results in either radcombobox - even though I have autopostback (they are set as default) set to true on both submit buttons.  Each stored procedure affects the other combo box data.
The rad windows are on the same page - and not on different pages.  I would like to keep it this way - is there any way that this result could be achieved?
Peter Filipov
Telerik team
 answered on 16 Apr 2013
1 answer
436 views
Hello,

I've the following code to bind:

var lstEmployees = employeeRepository.All.Select(employee => new { employee.Id, employee.Name });

txtEmployee.DataSource = lstEmployees.ToList();

txtEmployee.DataTextField = "Name";

txtEmployee.DataValueField = "Id";

txtEmployee.DataBind();

This code is called in the Page_Load() event inside the

if (!IsPostBack) block.

This triggers the error "The Control DataSource or (DataSourceID) is not set" when I start typing into it.
What I noticed is, when I move the binding code outside the if (!IsPostBack) block, it works correctly.

 

 

 

 

 

 

 

 

 

 

 

Princy
Top achievements
Rank 2
 answered on 16 Apr 2013
0 answers
86 views
Hi,

http://demos.telerik.com/aspnet-ajax/grid/examples/client/insertupdatedelete/defaultvb.aspx?#qsf-demo-source

I did the same thing, but the application does not work. I received the error: Microsoft JScript runtime error: 'MyWebServices' is undefined. I would ask for your help.
Thanks.
Tugba
Top achievements
Rank 1
 asked on 16 Apr 2013
6 answers
228 views
Hi,

we are using SignalR v 1.xx. And sometimes some errors bubble up in connection to Radcompression .

There are others with the same problem:
https://github.com/SignalR/SignalR/issues/1535

Fehlermeldung und Stack-Trace

Fehlermeldung: Microsoft.Owin.Host.SystemWeb: One or more errors occurred.

Stack-Trace: Server stack trace: Exception rethrown at [0]: bei Microsoft.Owin.Host.SystemWeb.Utils.<>c__DisplayClass1.

Is this a known problem?

Best 

Nils
Radoslav
Telerik team
 answered on 16 Apr 2013
1 answer
103 views
Hello,
 We want to implement the "Your Bookmarks" feature that happens when you click the Logged In User Icon.  Is that a RadControl of some sort?  Where is it located?

Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Apr 2013
5 answers
465 views
I have the following problem.

When a number in the grid is formatted in the format used in France (10 123 in stead of 10.123) and when i export to excel, excel does not see this as a number, because of the space.

Is there a way that it will always be exported as 10123, so without any formatting?
Shinu
Top achievements
Rank 2
 answered on 16 Apr 2013
1 answer
616 views
Hi,

When I tried to export data to excel, I'm unable to get date format. My date format is based upon my session settings. Date is displayed in grid as 10.01.2013 12.25.44. I want the same should be exported in excel. I'm using below code
protected void RadGrid1_ExcelMLExportStylesCreated(object source, GridExportExcelMLStyleCreatedArgs e)
        {
            StyleElement dateStyle = new StyleElement("Date");
            dateStyle.NumberFormat.FormatType = NumberFormatType.Fixed;
            dateStyle.NumberFormat.Attributes["ss:Format"] = "d";
            e.Styles.Add(dateStyle); 
        }
}

Thanks,
Kumar
Shinu
Top achievements
Rank 2
 answered on 16 Apr 2013
1 answer
327 views
Hi

I'm trying to implement a clientside custom validation for my rad grid, and while I have managed to write the javascript function that gets called when the custom validator is fired, I am not sure how to access the edit form controls inside the function.

Here's a stripped down version of my markup. 
Basically the grid has a "location" column and a "Storage Location" column and I use a FormTemplate based edit form for the insert/edit.
When inserting a record, I need to validate that only one of these two is selected.

<telerik:RadGrid
  SkinID="myTemplate"
  ID="myGrid"
  runat="server"
  DataSourceID="myDataSourceID"
  OnInsertCommand="OnInserting"
  OnUpdateCommand="OnUpdating">
   
  <MasterTableView
    DataKeyNames="myDataKey">
   
    <CommandItemSettings
      AddNewRecordText="Assign Location" />
 
    <EditFormSettings
      CaptionFormatString="Edit Location"
      InsertCaption="Add New Location"
      EditFormType="Template">
 
      <FormTemplate>
        <!--   Begin Edit Item Table Template   -->
 
          <table id="Table10">
 
            <tr>
              <td>
                <des:LocalizableLabel
                  ID="Location"
                  runat="server"
                  Text="Location"></des:LocalizableLabel>
              </td>
              <td>
 
                <aec:TelerikAutoCompleteBox
                  ID="locationsAutoComplete"
                  runat="server"
                  DataSourceID="sqlLocationAutocomplete"
                  DataTextField="Name"
                  DataValueField="Location_ID"
                  Filter="Contains"
                  TextSettings-SelectionMode="Single"
                  InputType="Text">
                </aec:TelerikAutoCompleteBox>
 
              </td>
            </tr>
 
            <tr>
              <td>
                <des:LocalizableLabel
                  ID="StorageLocation"
                  runat="server"
                  Text="Storage Location"></des:LocalizableLabel>
              </td>
              <td>
                <aec:TelerikDropDown
                  runat="server"
                  DataField="Storage_Location"
                  DataTextField="Storage_Location"
                  DataValueField="Storage_Location"
                  DataSourceID="sqlStorageLocation"
                  ID="storageLocationDropDown">
                </aec:TelerikDropDown>
               
                  <asp:CustomValidator
                    runat="server"
                    ID="customValidator1"
                    ClientValidationFunction="EquipmentLocation_ClientValidate"
                    OnServerValidate="validateLocation"
                    ControlToValidate="storageLocationDropDown"
                    ErrorMessage="Must select either Location or Storage Location."
                    Display="static">
                   </asp:CustomValidator>
              </td>
            </tr>
        </table>
        <AERadGrid:EditFormSaveCancelButtons
          ID="locationAssignEditFormButtons"
          runat="Server">
        </AERadGrid:EditFormSaveCancelButtons>
        <!--   End Edit Item Table Template   -->
 
      </FormTemplate>
 
    </EditFormSettings>
 
    <Columns>
      <telerik:GridBoundColumn
        UniqueName="Location_Name"
        HeaderText="Location"
        DataField="Location_Name">
      </telerik:GridBoundColumn>
 
      <telerik:GridBoundColumn
        UniqueName="Storage_Location"
        HeaderText="Storage Location"
        DataField="Storage_Location">
      </telerik:GridBoundColumn>
 
    </Columns>
  </MasterTableView>
</telerik:RadGrid>

Here's the JS
function EquipmentLocation_ClientValidate(source, args) {
 
    //get a reference to the calling validator control
    var CustomValidator1 = source.id;
 
    /* get the values of the location auto complete and the storage location ddl and compare.*/
    var storageLocation = args.Value;
    var location = ?? //GET the value out of the autocomplete box....how?  
 
}

Now the JS function does get called as expected, in which I want to check the selected values in the autocomplete and the dropdown and allow only one to be selected. The value of the drop down is directly available in the args, but I'm not sure how I can get the value out of the autocompletebox on the edit form.

How do we get it?

Thanks
mqsash
Top achievements
Rank 1
 answered on 15 Apr 2013
2 answers
164 views
When adding a LinkButton to a GridDataItem in an ajaxified RadGrid, it causes a full postback.  I do not want a full postback. 
This is my code:

private
void GridItem_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (e.Item as GridDataItem);
                 
 
                    //cannot .Clear() expand/collapse item
                    item["ExpandColumn"].Controls[0].Visible = false;
 
                    LinkButton expand = CreateLinkButton();
                    expand.CommandArgument = _expandText;
                    expand.ID = _btnExpand;
                    item["ExpandColumn"].Controls.Add(expand);
                     
                    LinkButton collapse = CreateLinkButton();
                    collapse.CommandArgument = _collapseText;
                    collapse.ID = _btnCollapse;               
                    item["ExpandColumn"].Controls.Add(collapse);
 
                    //hide collapse on load
                    item["ExpandColumn"].Controls[2].Visible = false;
 
                    foreach (Control control in item["ExpandColumn"].Controls)
                    {
                        RadAjaxManager RadAjaxManager1 =                RadAjaxManager.GetCurrent((System.Web.UI.Page)System.Web.HttpContext.Current.Handler);
                        RadAjaxManager1.AjaxSettings.AddAjaxSetting(control, (sender as RadGrid));
                    }
                }
}

I've even tried the below on RadGrid_PreRender with no luck

private void RadGrid_PreRender(object sender, EventArgs e)
        {
            RadAjaxManager RadAjaxManager1 = RadAjaxManager.GetCurrent((System.Web.UI.Page)System.Web.HttpContext.Current.Handler);
            RadAjaxManager1.AjaxSettings.AddAjaxSetting((Control)sender, (Control)sender);
           RadAjaxManager1.EnableAJAX = true;
        }

Katie Arnott
Top achievements
Rank 1
 answered on 15 Apr 2013
3 answers
209 views
Hello,

I'm using a grid in which I'm implementing custom filtering as shown in the documentation and in the online demos, but I'm having some difficulties in making it work properly.

My grid is defined as follows (to try and make it clearer, I'm only copying the impacted column):
<telerik:RadGrid ID="grdBusinessRoles" runat="server" AllowMultiRowSelection="false"
AllowFilteringByColumn="true" ShowFooter="false" AllowSorting="True" AutoGenerateColumns="False"
AllowPaging="true">
<MasterTableView AutoGenerateColumns="false" EditMode="InPlace" TableLayout="Auto"
CommandItemDisplay="Top" DataKeyNames="BusinessRoleId2,BusinessRoleId" PageSize="15">
<CommandItemTemplate>
<asp:LinkButton runat="server" ID="btnClear" Text="Clear Filters" CommandName="ClearFilters" />
</CommandItemTemplate>
<Columns>
<telerik:GridBoundColumn UniqueName="colStream" DataField="StreamName" HeaderText="Stream"
SortExpression="StreamName" ReadOnly="true">
<FilterTemplate>
<telerik:RadComboBox ID="rcbStreams" DataTextField="Value" DataValueField="Value"
AppendDataBoundItems="true" AutoPostBack="false" SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("colStream").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="SelectedIndexChanged">
<Items>
<telerik:RadComboBoxItem />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function SelectedIndexChanged(sender, args) {
var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
tableView.filter("colStream", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
</Columns>
<NoRecordsTemplate>
<asp:Label runat="server" ID="lblNoRecords" Text="No Business Roles found."></asp:Label>
</NoRecordsTemplate>
<PagerStyle PageSizeControlType="RadComboBox" />
</MasterTableView>
<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
<ClientSettings EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>

This grid is contained in a user control, which is contained in another user control, as follows (ucBusinessRoles is the user control containing the grid):
<!-- Select Business Roles -->
<telerik:RadWindow runat="server" ID="wdwBusinessRoles" Modal="true" Width="820px"
   Height="500px" Behaviors="Close" CssClass="RadWindow_Pram">
   <ContentTemplate>
      <telerik:RadAjaxPanel ID="pnlBusinessRoles" runat="server">
      <pram:ucBusinessRoles ID="ucSelectBusinessRole" runat="server" TypeOfList="AssignRoleVariants"
         TypeOfSelection="SingleSelection" AllowNavigation="False" AllowNewBusinessRole="False" />
      </telerik:RadAjaxPanel>
      <telerik:RadButton ID="btnAddRolesToList" runat="server" Text="Select Role" CssClass="RadButton_Pram submit" />
   </ContentTemplate>
</telerik:RadWindow>

The RadComboBox used for filtering is bound to a dictionary, as follows:
Protected Sub grdBusinessRoles_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) _
   Handles grdBusinessRoles.ItemCreated
 
   If TypeOf (e.Item) Is GridFilteringItem Then
      Dim filterItem As GridFilteringItem = CType(e.Item, GridFilteringItem)
      Dim combo As RadComboBox = CType(filterItem("colStream").FindControl("RadComboBoxClientName"), RadComboBox)
 
      combo.DataSource = Streams ' This is a Dictionary(Of Decimal, String)
      combo.DataValueField = "value"
      combo.DataTextField = "value"
   End If
 
End Sub

And the whole grid is bound in the NeedDataSource event.

The grid is displayed correctly and the drop-down list is populated correctly, but if I select a in the drop-down list to filter by it, then the grid refreshes and all the records are "filtered" (so it doesn't matter which value I select for filtering: I will always get no results, even if the list contains valid items), so the filtered grid will always be empty (see attachments).

I've tried several approaches and followed the tutorials and demos, but I couldn't get this working.

What am I doing wrong?

Thanks in advance.

Elliott
Top achievements
Rank 2
 answered on 15 Apr 2013
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?