Telerik Forums
UI for ASP.NET AJAX Forum
15 answers
1.0K+ views
I have a complex rule that requires getting a value in edit mode. depending on the on the value that was retrieved, set a value in another cell that is in editmode.  And, set a value in another cell on a previous row (if it exists).

 All this needs to be done by clicking a button other than the Update Button. (assuming I will be using the event RadGrid1_ItemCommad)

grid is AutoGenerateColumns="False"  EditMode="EditForms"

IS IT POSSIBLE?

Thanks

Veli
Telerik team
 answered on 16 Feb 2011
4 answers
191 views
Hello,

I've got a radgrid with a GridTemplateColumn that has a Label that I set to display my data within the column.  I do this because the object that I'm binding to contains a list of objects.  Using a GridTemplateColumn allows me to display these 1 to many values the way I want to display them.

Now, filtering does not seem to work correctly with this setup.

I've searched the forum and found that you can set the DataField property on the GridTemplateColumn and the filtering will use that field.

Unfortunately, I'm not able to set the DataField property because I want to search within a list of objects.

If I place the name of the List, in this case ICodes, in the DataField property, and then perform a filter, I receive an error.

What is the best way to handle my scenario?

I want to allow the user to type a string within the filter box and use that string to filter within a list.  Is this possible?  Is there an event I can handle to do this work on my own?

Thanks!

Coy
Veli
Telerik team
 answered on 16 Feb 2011
3 answers
362 views
Hi all,
 I'm using RadGrid in Edit mode, with some GridDropDownColumns with the default GridDropDownListColumnEditor. I can even setup the client side event handler for the SelectedIndexChanged event. There I use a javascript alert() to see the contents of the combo.

The challenge is now to transfer this value to another Combobox a) in the same row or b) in another row.

How can i set the Combobox from the client side javascript?
Princy
Top achievements
Rank 2
 answered on 16 Feb 2011
1 answer
201 views
Hello,

I have a basic Grid composed with one GridDropDownColumn.

The grid is filled through ObjectdataSource1 :
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
           OldValuesParameterFormatString="original_{0}" OnSelecting="ObjectDataSource1_Selecting"
           SelectMethod="select_AllWeek" TypeName="Planning.WeekDAL" 
           DataObjectTypeName="Planning.Week" UpdateMethod="update_Week">
           <SelectParameters>
               <asp:Parameter Name="IdFrame" Type="Int32" />
           </SelectParameters>
       </asp:ObjectDataSource>

The SelectMethod returns a generic List of Week:
[DataObjectMethod(DataObjectMethodType.Select)]
       public static List<Week> select_AllWeek(int IdFrame)
       {...}


The DropDownColum is filled through ObjectDataSource2:
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}"
           SelectMethod="select_Alldays" TypeName="Planning.DayDAL"></asp:ObjectDataSource>

The SelectMethod returns a generic List of Day:
[DataObjectMethod(DataObjectMethodType.Select)]
        public static List<Day> select_AllDays()
        {
....}


The Grid is configured like that:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSource1">
            <MasterTableView DataSourceID="ObjectDataSource1" EditMode="InPlace">
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" Groupable="False"
                        HeaderText="Week" UniqueName="Week" DataField="Libelle">
                    </telerik:GridBoundColumn>
                    <telerik:GridDropDownColumn DataSourceID="ObjectDataSource2" ListTextField="Code"
                        ListValueField="Id" DataField="Monday.Id" UniqueName="Monday" HeaderText="Monday"
                        FooterStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" AllowFiltering="False"
                        AllowSorting="False" Groupable="False">
                    </telerik:GridDropDownColumn>
                     <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" Groupable="False"
                        HeaderText="Tuesday" UniqueName="Tuesday" DataField="Tuesday.Code">
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn>
                    </telerik:GridEditCommandColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>

The Week class is defined like that :
public class Week: IEnumerable
    {
  
        #region Fields
  
        protected List<Day> Days= new List<Day>();
  
        private int _id;
   ...

# region properties

     public Day Monday
        {
            get{return Days[0];}
            set{Days[0] = value;}
        }


and the Day class :

public class Day
    {
        #region Fields
  
        private int _id;
        private string _code;
       ...
#endregion
  
  
        #region Properties
  
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }
  
        public string Code
        {
            get {return _code;}
            set  { _code = value;}
        }
...
]


The values are correctly displayed in both Grid and DropdownList. The problem is during the update phase.  

The Update method of the ObjectDataSource1 is defined like that:

[DataObjectMethod(DataObjectMethodType.Update)]
        public static void update_Week(Week oneweek)
        {
            PrepareConnexion();
            connexion.Open();
            ...


The selected value of the Dropdownlist  ("Code" property of the Day object) is not saved in the database. It seems there is "no link" between RadGrid and Dropdowlist controls. What is the best practise to link a GridDropDownColumn Value in a  RadGridView Using ObjectDataSource (one for Dropdownlist and one for Gridview) ?

Thanks for your support.

Regards,

Stephane


































































Veli
Telerik team
 answered on 16 Feb 2011
1 answer
73 views
Hi,
I am developing a scheduler system taking Telerik Rad Scheduler as base. I am customizing it maximum as per my choice and design.If I want to deploy it in my commercial website, can I do it?
Veronica
Telerik team
 answered on 16 Feb 2011
5 answers
84 views
Hi. I'm trying to use the RadTagCloud. I am trying to build the content iteratively with code behind (upon certain events items will get added to the cloud).

In code behind I have:
                var nodes = from n in dContext.table where select n;
                foreach (var j in nodes)
                {
                    RadTagCloudItem item = new RadTagCloudItem()
                    {
                        Text = j.Description,
                        DataItem = j.CtId
                    };
                    myCloud.Items.Add(item);
                }

This works fine. If I watch the cloud in debug mode I items.count increases and I can view individual RadTagCloudItems and they contain text and dataItems.

However, I also have a method for the itemClick event:
    protected void myCloud_ItemClick(object sender, RadTagCloudEventArgs e)
    {
        doSomething(Convert.ToInt16( e.Item.DataItem));
    }

When this executes the e.item.DataItem is null and if I view myCloud the dataitem for every item in the items collection is null. WHY?
Pero
Telerik team
 answered on 16 Feb 2011
1 answer
122 views
Hello,

I have a page that inherits from compositecontrol and i am trying to load the filter the first time the page loads but i'm getting the following exception:

PS - i am able to load the filter on postback..

Object reference not set to an instance of an object. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
  
Source Error: 
  
  
Line 537:                {
Line 538:                    ((IStateManager)myRadFilter.RootGroup).LoadViewState(DoFilterSerialize(new BL.GPSearchFilterBL(RequestParam.RequestParamIntValue("SID")).SearchFilter));
Line 539:                    myRadFilter.RecreateControl();
Line 540:
Line 541:                    myRadFilter.FireApplyCommand();
   
  
Source File: C:\Projectos\DotNetFramework35\FrameworkSolution\AmbiSIG.GeoPortal.Web.Map.TG\UI\WebControls\ResultsControl\ResultsControl.cs    Line: 539 
  
Stack Trace: 
  
  
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadFilterDataFieldEditor.CreateEditorFrom(RadFilterDataFieldEditor baseEditor) +9
   Telerik.Web.UI.RadFilterDataFieldEditorCollection.RetrieveEditorForFieldName(String fieldName) +106
   Telerik.Web.UI.RadFilterSingleExpressionItem.SetupFunctionInterface(Control container) +55
   Telerik.Web.UI.RadFilterExpressionItem.CreateFunctionalInterface() +72
   Telerik.Web.UI.RadFilter.CreateFilterItems() +286
   Telerik.Web.UI.RadFilter.CreateControlHierarchy() +13
   Telerik.Web.UI.RadFilter.CreateChildControls() +87
   System.Web.UI.Control.EnsureChildControls() +87
   Telerik.Web.UI.RadFilter.get_RootGroupItem() +21
   Telerik.Web.UI.RadFilter.RecreateControl() +12
   AmbiSIG.GeoPortal.Web.Map.TG.UI.WebControls.ResultsControl.ResultsControl.DoOnLoad(EventArgs e) in C:\Projectos\DotNetFramework35\FrameworkSolution\AmbiSIG.GeoPortal.Web.Map.TG\UI\WebControls\ResultsControl\ResultsControl.cs:539
   AmbiSIG.GeoPortal.Web.UI.BaseCompositeControl.OnLoad(EventArgs e) in C:\Projectos\DotNetFramework35\FrameworkSolution\AmbiSIG.GeoPortal.Web\UI\BaseCompositeControl.cs:109
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
  
  
Martin
Telerik team
 answered on 16 Feb 2011
1 answer
194 views
I have button which launch ajax request. That button manage a panel.
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="button_launcher">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="panel" />
        </UpdatedControls>
    </telerik:AjaxSetting>
</AjaxSettings>
I can change size of panel in server-side. But sometimes I need manage other elements which unavailable in server-side. So I want to calculate values and pass it to client-side and then make changes which I need to do. After long searching I did not find how to do that. Now I do it in ugly way - I write this parameters on hidden labels and then parse it in OnResponseEnd function. Can I avoid it somehow?
Iana Tsolova
Telerik team
 answered on 16 Feb 2011
1 answer
84 views
I'm trying to find an example where someone has a tooltip that changes PER row.  I understand that on itemdatabound I can change the values within the tooltip.  However, I can't find an example of how to put the radtooltip within the grid so that you can call it per row.  Anyone???

Iana Tsolova
Telerik team
 answered on 16 Feb 2011
1 answer
96 views
Hi

I Read Many forums but i didnt got the solution for this?

I will have my aspx code here
<Code>
  <telerik:RadGrid runat="server" ID="radgvInbox"  AutoGenerateColumns="false"  
GridLines="None"  Width="100%" BorderWidth="0px" AllowSorting="True" 
ShowGroupPanel="True"  style="margin-right: 0px" AllowPaging="true" Height="300px" 
            onprerender="radgvInbox_PreRender1">
             
                     <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true" Selecting-AllowRowSelect="true"
EnablePostBackOnRowClick="true" AllowDragToGroup="true" EnableRowHoverStyle="true" 
                      AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                    <Selecting AllowRowSelect="True" />                                   
                    <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                    ResizeGridOnColumnResize="False"></Resizing>
                    </ClientSettings>
                                             
                    <MasterTableView TableLayout="Fixed" GroupLoadMode="Client" DataKeyNames="MessageID"
AdditionalDataFieldNames="Date" UseAllDataFields="true" RetrieveAllDataFields="true">                                         
                     <GroupByExpressions>
<telerik:GridGroupByExpression>
<GroupByFields>
<telerik:GridGroupByField FieldName="Received" HeaderValueSeparator=":" SortOrder="Descending" />
</GroupByFields>
<SelectFields>
<telerik:GridGroupByField FieldName="Received" HeaderText="Date" FormatString="{0:d}" />
</SelectFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>


       <Columns>
                            <telerik:GridBoundColumn DataField="From" HeaderText="From">
       </telerik:GridBoundColumn>
                          <telerik:GridBoundColumn DataField="Subject" HeaderText="Subject">
       </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Received" HeaderText="Received">
       </telerik:GridBoundColumn>
                        </Columns>

                    </MasterTableView>                        
                </telerik:RadGrid>
</Code>

In cs page

 radgvInbox.DataSource = dr;
        radgvInbox.DataBind();


thats what i am doing why i am getting that error..i think i missed a small thing ..will anyone help regarding this issue please
Princy
Top achievements
Rank 2
 answered on 16 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?