Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
246 views
I've the following nested Grid structure.

<telerik:RadGrid ....>
   <MasterTableView...>
         <DetailTables>
            <GridTableView  Name="Users".....>
                  <Columns>
                          <telerik:GridBoundColumn UniqueName="Status" DataField="Status" HeaderText="Status"  AllowFiltering="false" />
                  </Columns>
                 <NestedViewTemplate>
                              ...................
                 </NestedViewTemplate>     
              </GridTableView>
           </DetailTables>
      <Columns>
           ............
      </Columns>
   </MasterTableView>
 </telerik:RadGrid>

I want to hide the NestedViewTemplate if "Status" has some specific value.

I'm binding the DetailTable as follows and probably can access the current item's Status value in the same event but not sure how to do that.

 protected void RadGridTest_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
            switch (e.DetailTableView.Name)
            {
                case "Users":
                    {
                        int testID = Convert.ToInt32(dataItem.GetDataKeyValue("ID"));
                        e.DetailTableView.DataSource = UserInTest.GetUsersInTest(testID,"Untaken");
                        break;
                    }


            }
        }

So, how can I access the current item's Column values of DetailTable and the NestedViewTemplate to hide it if the column (Status) has a certain value.

Andrey
Telerik team
 answered on 19 Mar 2013
1 answer
108 views
There doesnt seem to be a way to get around the FileSharing error when a user attempts to upload a file that happens to be open on their own desktop locally (like an Excel file).

Why hasn't Telerik fixed it yet? If so what is the workaround 'cause it ain't built into the control and all the relevant topics deadend with no resolution.
Plamen
Telerik team
 answered on 19 Mar 2013
1 answer
175 views
Hi, I am using the RadAsyncUpload without enabling plugins, so I am using straight-up javascript on my page. In other words I have the property DisablePlugins="True".

My problem is that I can not distinguish the reason for error when the user atempts to upload a file that happens to be open at the time of the upload attempt, essentially this is a file-sharing error.

I know that you can distinguish the difference from the wrong extension and the max size errors by this post:

http://www.telerik.com/help/aspnet-ajax/asyncupload-onclientvalidationfailed.html

I cannot, however, find javascript code that will distinguish these two possible errors:

1) wrong extension
2) max file size

...as well as

3) file-sharing (while the file is open and upload attempted on it)

All three at once.

???

There seem to be solutions if you are using Silverlight, but if you are not, you do not have access to same objects and properties that you would if I was assuming the use of Silverlight.
Plamen
Telerik team
 answered on 19 Mar 2013
2 answers
91 views
Hello!This is a rather large post and if a support ticket is needed that one can be created. The problem is that we are using a RadGrid with check box filtering and when the first item check box is selected then deselected the filter dropdown closes but the first item check box is still selected. By first item I do not mean the “Check All” check box but the very next check box after that one. What does work is after selecting the first check then selecting and deselecting any other check box will clear the filter. Also, the problem does not happen with any other item check box except the first one located in the selection dropdown below “Check All”. This means that, on start, if you select the second item checkbox, or any other but the first, then deselect it the filter clears. Below is a copy of the code below:Thanks,Steve Holdorf

 

ASPX PAGE MARKUP

RadGrid Layout:

Kostadin
Telerik team
 answered on 19 Mar 2013
1 answer
145 views
Hi 

I need to implement the find functionality in radgrid . 
Ex : I have a find button & clicking upon i get a find window as follows . Whatever i type in pop up find windows those items rows should be highlighted in radgrid . 

MasterChiefMasterChef
Top achievements
Rank 2
 answered on 19 Mar 2013
2 answers
120 views
Hi,

I am using a Rad scheduler and I'm binding a generic list to the Rad Scheduler. Everything works fine. But I want to set the visibility property of each appointment from the visibility property of the corresponding item in the list. How can I achieve this?

Regards,
Navaneeth
Navaneeth Kumar
Top achievements
Rank 1
 answered on 19 Mar 2013
5 answers
209 views
I am trying to use the AutoCompleteBox control.

I only want to let the user select one instance of each token. My list of tokens contains "Test 1, "Test 2" and "Test 3".

I am using a function on the OnClientEntryAdding that checks whether the entry has already been added.
<script type="text/javascript">
    function entryAdding(sender, eventArgs) {
        var txt = sender.get_text();
        var entries = sender.get_entries(),
        count = entries.get_count();
        for (var i = 0; i < count; i++) {
            if (entries.getEntry(i).get_value() == eventArgs.get_entry().get_value()) {
                eventArgs.set_cancel(true);
            }
        }
    }
</script>

If I type in "Test" and select "Test 1", it's added to the list of tokens. If I type in "tes" and then select "Test 1" then the token is not added which is what I want. But if I then type in "tes" and select "Test 1" then the event is cancelled but the text in the control is "Test 1 ;tes". It seems that the text is still changed even if the entry has been cancelled. How can I prevent it from adding an invalid token?

If I save the entries, then it's ok because the collection of entries doesn't contain the invalid entry but I don't want to display that invalid entry.

Below is the setting of my control

<telerik:RadAutoCompleteBox runat="server" ID="ACBVoie" DataTextField="Desc_No_Voie" DataValueField="No_Voie" InputType="Token" width="100%" OnClientEntryAdding="entryAdding" AllowCustomToken="false">
</telerik:RadAutoCompleteBox >

Thanks




Srimanta
Top achievements
Rank 1
 answered on 19 Mar 2013
3 answers
144 views
Hello Forum,
we are using the RadAsyncUpload for an ImageUpload.
I am currently working on the user friendliness of our application.
When i change the name of for example a Message-File from "MyMessage.msg" to "MyMessage.png" it will pass through the validation but the Visual Studio shows a exception. For the user however its just like everything went well.
Except it leads to problems later because the uploaded file is not really an Image...

Is there any way to catch this error, so i can show an alert to the user?
Torben
Top achievements
Rank 1
 answered on 19 Mar 2013
2 answers
128 views
I'm looking at your demo http://www.telerik.com/help/aspnet-ajax/grid-linq-to-sql-manual-crud-operations.html.

I've used it successfully in the past but now I need a combo box dropdown and I'm getting nowhere.  It crashes on Object reference not set to an instance of an object.

Where is a decent example?
-----------------------
Here's my code.  I've already verified that the correct data is being returned to the DataSource.

  GridDropDownListColumnEditor rcb = ((GridDropDownListColumnEditor)editableItem.EditManager.GetColumnEditor("Field1"));
  rcb.DataTextField = "text";
 rcb.DataValueField = "value";           
 rcb.DataSource = HSSDDataLayerStatic.getFieldStatus();
 rcb.DataBind();            
 inputSetting.TargetControls.Add(new TargetInput(rcb.UniqueID, true));


Boris
Top achievements
Rank 1
 answered on 19 Mar 2013
2 answers
142 views

In a older version of asp controls, I create a simple validation on the OnItemCreated event of radgrid and works great, but in the latest version of asp controls every time I click edit or create new record throws exception"Microsoft JScript: Sys.WebForms.PageRequestManagerServerErrorException: Editor cannot be initialized for column: [Name column]". I've the same code in several places in my website.

here is my code:

.cs
        protected void gridFases_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = e.Item as GridEditableItem;
                GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor("Nombre");
                TableCell cell = (TableCell)editor.TextBoxControl.Parent;

                RequiredFieldValidator validator = new RequiredFieldValidator();
                editor.TextBoxControl.ID = "Nombre";
                validator.ControlToValidate = editor.TextBoxControl.ID;
                validator.ErrorMessage = "El nombre de la fase es obligatorio.";
                cell.Controls.Add(validator);

            }
        }

.aspx

<telerik:RadGrid ID="gridFases" runat="server"
                OnNeedDataSource="gridFases_NeedDataSource"
                OnInsertCommand="gridFases_InsertCommand" 
                OnUpdateCommand="gridFases_UpdateCommand" 
                OnItemCreated="gridFases_ItemCreated">
            <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="Id" InsertItemPageIndexAction="ShowItemOnCurrentPage" >
                <NoRecordsTemplate>
                    <div>
                        No hay fases asociadas
                    </div>
                </NoRecordsTemplate>
                <CommandItemSettings  AddNewRecordText="Nueva fase" RefreshText="Refrescar" ShowRefreshButton="false"  />
                <EditFormSettings>
                    <EditColumn EditText="Guardar" CancelText="Cancelar"  UpdateText="Actualizar" InsertText="Guardar"></EditColumn>
                </EditFormSettings>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="OrdenEjecucion" SortOrder="Ascending" />
                </SortExpressions>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton"  />
                    <telerik:GridBoundColumn DataField="Id" HeaderText="Id" UniqueName="Id" Visible="false" ReadOnly="true" />
                    <telerik:GridTemplateColumn DataField="OrdenEjecucion" HeaderText="Orden de ejecución" UniqueName="OrdenEjecucion">
                        <InsertItemTemplate>
                            <telerik:RadNumericTextBox ID="txtOrdenEjecucion" MinValue="1" MaxValue="100" runat="server" ShowSpinButtons="True" Value="1">
                                <NumberFormat AllowRounding="True" KeepNotRoundedValue="False" DecimalDigits="0"/>
                            </telerik:RadNumericTextBox>
                        </InsertItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox ID="txtOrdenEjecucion" MinValue="1" MaxValue="100" runat="server" ShowSpinButtons="True" Value='<%#Convert.ToDecimal( Eval("OrdenEjecucion")) %>'>
                                <NumberFormat AllowRounding="True" KeepNotRoundedValue="False" DecimalDigits="0"/>
                            </telerik:RadNumericTextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "OrdenEjecucion")%>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="Nombre" HeaderText="Nombre de la fase" UniqueName="Nombre" Visible="true"/>
                    <telerik:GridCheckBoxColumn DataField="Obligatorio" HeaderText="¿Fase obligatoria?" UniqueName="Obligatorio"  Visible="true"/>
                </Columns>
            </MasterTableView>
            <ValidationSettings EnableValidation="true" />
        </telerik:RadGrid>
Maria Ilieva
Telerik team
 answered on 19 Mar 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?