Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
206 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
78 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
88 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
129 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
200 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
91 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
100 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
1 answer
101 views
Hello,

Is there any simple tutorial to start with Template Columns with constant data ? like in column types demo there is a mess of all columns types, it sounds creepy.
Shinu
Top achievements
Rank 2
 answered on 16 Feb 2011
0 answers
128 views
Hello,

I have a simple example in which the javascript function is executed after a postback to clear a load-on-demand box which allows
custom text to be entered:

function Clear(){
var combo = $find("<%= RadComboBox1.ClientID %>");  
combo.clearSelection(); 
}

When I put a break on the function, I can see that the combo object is having a value OK.
But the IE 8 browser complians the clearSelection() is not a valid method!

I tried to use the set_text() and set_value() but then I do not see the Empty message string!

Is there any way to preserve the empty message and de-select a item?

Thanks,
Sanjay

Any help

Sanjay
Top achievements
Rank 1
 asked on 16 Feb 2011
2 answers
60 views
Hi,

I have a Rad Grid. In that Rad Grid, I used the EditFormType="WebUserControl". 
So, I have a User Control. In that user control, I have a search button.
If click on the search button, I want to show the rad window (window.radOpen).

How can i write that javascript function in user control by radgrid?

Please help me out.

Regards,
Sundee.

Su
Top achievements
Rank 1
 answered on 16 Feb 2011
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?