Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
201 views
Hi,
I have set on my grid AllowMultiRowSelection="False".
My Problem is :
I have a Master Table and Detail Table,.
On my Details Table i have a Hyper link. When User click on that Hyperlink i am selecting Parent-row and Details Table Hyperlink Clicked Row. But the Problem is, if i click on any other hyperlink it's selecting multiple rows even if i set AllowMultiRowSelection="False"

here is my code 
ASPX:
<telerik:GridTemplateColumn UniqueName="Tempcol" >
  <ItemTemplate>
     <asp:HyperLink ID="HyperLink1" runat="server" Text="ClickMe"  ></asp:HyperLink
   </ItemTemplate>
</telerik:GridTemplateColumn>

CS
protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.OwnerTableView.Name == "DetailTable" && e.Item is GridDataItem )
        {
             HyperLink hLink = (HyperLink)item.FindControl("HyperLink1");
             hyplnk.Attributes.Add("OnClick", "return OpenLink('"+ item1.ItemIndex +"');");             
        }
    }

JavaScript
function OpenLink(indx)
     {
      var RadGrid2 = $find("<%= RadGrid2.ClientID %>");
      RadGrid2.get_masterTableView().get_dataItems()[indx].set_selected("true");
     }

Viktor Tachev
Telerik team
 answered on 14 Jan 2014
7 answers
214 views
Hi

I got this Issue: Items in the DetailTable are not in Editmode if I collapse a ParentItem Serverside.
If the ParentItem is expanded on the Server, all DetailTable-Items stays in Editmode.

Description:
- Grid with 2 Categories
- Each Categories hold 3 Items in DetailTable
- All DetailTable-Items are set to Editmode (Serverside)

Scenario 1:
- 6 of the DetailTable Items are listed as editedItems.
After Grid_Prerender() I collapse 1 Category. Only 3 of the DetailTable Items are listed as editedItems.

Scenario 2:
- 6 of the DetailTable Items are listed as editedItems.
After Grid_Prerender() I collapse both Categories. None of the DetailTable Items are listed as editedItems.

Scenario 3:
- 6 of the DetailTable Items are listed as editedItems.
After Grid_Prerender() I expand all Categories. All 6 of the DetailTable Items are listed as editedItems.


I noticed, the same moment a category is collapsed, all his DetailTable-Items are no longer listed as editedItems. Expanding the Category just afterwards doesn't bring the Items back in the editedItems.

Is there something I miss? How can I let all DetailTable-Items staying in Editmode even if I collapse a Parent Serverside?


TIA
Markus
Konstantin Dikov
Telerik team
 answered on 14 Jan 2014
2 answers
107 views

I have a rad grid that I bind on page load (using basic data binding). 

gvCompetency.DataSource = competencies; //data sorted and returned by SP.
gvCompetency.DataBind();


I get the data from a Stored Procedure, sorted by some complex business rules.

I am using <GroupByExpressions> to group some fields together (See my code below). Once I do this, my original sort is lost which is very important. How can I keep my original sort? Need help fast. Thank you!

<GroupByExpressions>
<telerik:GridGroupByExpression>
           <SelectFields>
                     <telerik:GridGroupByField FieldAlias="Service Line"  FieldName="GroupName"></telerik:GridGroupByField>
                           </SelectFields>       
                           <GroupByFields>
                               <telerik:GridGroupByField FieldName="GroupName"></telerik:GridGroupByField>
                           </GroupByFields>
 </telerik:GridGroupByExpression>
</GroupByExpressions>

Please help.

Thanks

Liby George
Liby George
Top achievements
Rank 1
 answered on 14 Jan 2014
2 answers
101 views
Is there a way to persist a control that is derived from a supported Telerik control?

I have tried using the declarative syntax and also adding it in code with a cast to the base control, but I receive a message that the control is not supported.  I would think that it should be able to treat the control as the base object and persist the state it is aware of.

public class MyGridView : RadGrid
Peter Filipov
Telerik team
 answered on 14 Jan 2014
4 answers
308 views
Greetings,

I have a setup in which I want to set the values of cells of a certain column programmatically. The column won't be displayed to the user, so I set Display=false

The grid is a batch mode grid, and I set the values before the user saves the data as follows:

grid.add_command(function (sender, args)
        {
            if(args.get_commandName() == "BatchEdit")
            {
                var tv = grid.get_masterTableView(),
                    bm = grid.get_batchEditingManager(),
                    dumpCellIndex = tableView.getColumnByUniqueName("Dump").get_element().cellIndex;
 
                tv.get_dataItems().forEach(function (di)
                {
                    var row = di.get_element();
 
                    if(row._data)
                        bm.changeCellValue(row.cells[dumpCellIndex], row._data.join(";"));
                });
            }
        });

On the server, I get the following error in the BatchEditCommand event handler when I try to access the Commands member of GridBatchEditingEventArgs: "Editor cannot be initialized for column: Dump"

I tried to set Display=true but still the problem happens. Dump is just a simple GridBoundColumn:

<telerik:GridBoundColumn Display="true" DataType="System.String" FilterControlAltText="Filter Dump column" UniqueName="Dump" ReadOnly="false" ForceExtractValue="None">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>

أشرف
Top achievements
Rank 1
 answered on 14 Jan 2014
2 answers
159 views

I have a radtextbox that I want to utilize the OnTextchange event.

No matter what I input into the text box I immediately get "JavaScript runtime error: Unterminated string constant".



Has anyone else seen this? Nothing too complex here.



Inside my aspx

<telerik:RadTextBox ID="formLocZip" runat="server" EmptyMessage="Zip" MaxLength="7" OnTextChanged="formLocZip_TextChanged" AutoPostBack="true">

</telerik:RadTextBox>




Inside my code behind :



Protected Sub formAddLocZip_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles formAddLocZip.TextChanged


Hristo Valyavicharski
Telerik team
 answered on 14 Jan 2014
3 answers
239 views

Hello,

 

I am having an issue with the required field validator control when validating any of my RadAutoCompleteBox controls.  After I type in some text and then select the entry from the pop up list, the validator fires and comes back as false showing the error message I put in there that the field is required.

 

So I have two questions:

 

  1. Why is the validator coming back as false when I clearly selected an entry and the field is not blank?
  2. Why does the validator for this control keep firing prior to me hitting the button for submitting the form?

Thanks,
Ron

Ron
Top achievements
Rank 2
 answered on 14 Jan 2014
2 answers
775 views
Greetings all,

I am trying to supress/hide the border that appears around a radio button when it is selected.  I'm using the RADButton control with the button type set to ToggleButton and ToggleType set to Radio.  Please see attached example.  When an option is clicked, the box appears around the text, which I don't want displayed.  I've tried adding the CssClass tag to the RadButton control to override the border attributes, but this seems to have no effect.  The buttons are also set to use the Default skin.  I've also tried setting the "EnableEmbeddedBaseStyleSheet" and "EnableEmbeddedSkins" properties to False, but this does not work.

Any thoughts or suggestions would be appreciated!

Thank you.



Bob
Top achievements
Rank 1
 answered on 14 Jan 2014
2 answers
500 views
Hi,
I have created a custom http handler but I don't see that it is being called. When I put a breakpoint in the code for the custom handler, it never gets hit. I also see that when I cast the UploadResult object to my custom result object in the server side FileUploaded event after a postback, I get null.

It was working locally in VS2010 before I registered the handler in web.config. But I had to register the handler to deploy it to my IIS server.

What am I doing wrong?


Here is a snippet of what I'm doing.

Here is my upload control:
<telerik:RadAsyncUpload
        Width="225px"
        TargetFolder="~/Temp/TempUploadFiles"
        ID="upFiles"
        runat="Server"
        InputSize="20"
        AllowedFileExtensions="jpeg,jpg,gif,tif,png,bmp,pdf"
        OnFileUploaded="RadAsyncUpload1_FileUploaded"
        OnClientFileUploading="upFiles_onClientFileUploading"
        OnClientFileUploaded ="upFiles_onClientUploadFinished"
        OnClientFileUploadFailed="upFiles_onClientUploadFailed"
        OnClientFileDropped="upFiles_onClientUploadDropped"
        OnClientFileUploadRemoved="upFiles_onClientUploadRemoved"
        OnClientValidationFailed="OnClientValidationFailed"
        HttpHandlerUrl="~/UserControls/CustomHandlers/UploadHandler.ashx"
        MaxFileInputsCount="1"
        TemporaryFileExpiration="5"
        DisableChunkUpload="true"
        ><FileFilters><telerik:FileFilter Extensions="jpeg,jpg,gif,tif,png,bmp,pdf" /></FileFilters>
 </telerik:RadAsyncUpload>

This is my Custom Handler:
public class UploadHandler : AsyncUploadHandler, System.Web.SessionState.IRequiresSessionState
{
  
    protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
    {
        // Populate the default (base) result into an object of type SampleAsyncUploadResult
        CustomAsyncUploadResult result = CreateDefaultUploadResult<CustomAsyncUploadResult>(file);
 
        //do some processing here...
        base.Process(file, context, configuration, tempFileName);
 
        return result;
    }
}


I have registered the handler in web.config:
<Configuration>
       ...
      <httpHandlers>
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
      <add path="UserControls/CustomHandlers/UploadHandler.ashx" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
    </httpHandlers>
    <httpModules>
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
      <add name="RoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>
   ...
   <system.webServer>
      <handlers>
      <remove name="ChartImage_axd" />
      <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
      <remove name="Telerik_Web_UI_DialogHandler_aspx" />
      <remove name="Telerik_RadUploadProgressHandler_ashx" />
      <remove name="Telerik_Web_UI_WebResource_axd" />
      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
      <add name="UserControls/CustomHandlers/UploadHandler_ashx" verb="*" preCondition="integratedMode" path="UserControls/CustomHandlers/UploadHandler.ashx" type="Telerik.Web.UI.WebResource" />
    </handlers>
    <validation validateIntegratedModeConfiguration="false" />
 </system.webServer>
   ...
</Configuration>
Hristo Valyavicharski
Telerik team
 answered on 14 Jan 2014
1 answer
191 views
Greetings,

I was in bad need to RowClosing, RowClosed, RowOpening, and RowOpened client side events (I hope these will be added to a future release), so I tried to implement my own.

I planned to handle the respective BatchEdit events. They're called for each cell, so I need to detect their call on first and last editable cells of a row to fire the proper event.

Here are some of my code:

function _findVisibleEditableColumn(col)
    {
        return !col.get_readOnly() && col.get_visible();
    }
 
grid.add_batchEditClosed(function (sender, args)
        {
            var lastVisibleEditableColumn = _.findLast(gridColumnsSortedByDisplayIndex, _findVisibleEditableColumn);
 
            if(lastVisibleEditableColumn && lastVisibleEditableColumn.get_uniqueName() == args.get_columnUniqueName())
                grid.raise_batchEditRowClosed(args);
        });

The event handler uses lo dash findLast function to find the last editable column. The callback _findVisibleEditableColumn uses the ReadOnly property to determine that the column is editable. This theoretically looks good. But I found that this doesn't cover a real scenario.

I had a grid which had the last column a TemplateColumn without edit or insert templates specified. This column passed the check. Its ReadOnly property returns false but the BatchEditClosed event is not called for it.

I examined the Telerik.Web.UI.GridColumn objects in the inspector and found that they have a private _data object which has the property Editable.
get_readOnly property code is as follows:

get_readOnly:function(){return(typeof(this._data.ReadOnly)!="undefined")?true:false;
}

It doesn't use the _data.Editable property.

At last I modified my filter function as follows:

function _findVisibleEditableColumn(col)
    {
        return !col.get_readOnly() && col.get_visible() && col._data.Editable;
    }

This seems to be working well. But is this the right solution? What's the reliable method to determine if a column is editable?
Angel Petrov
Telerik team
 answered on 14 Jan 2014
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?