Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
79 views
Ok so i have got unavailable times working following the code found elsewhere in this form but for some reason it is not being specific to the Resource
01./// <param name="e">The <see cref="TimeSlotCreatedEventArgs"/> instance containing the event data.</param>
02.    protected void apertureAppointments_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
03.    {
04.        foreach (DateTime dt in SpecialDays)
05. 
06.        {
07.            if (DateTime.Compare(e.TimeSlot.Start.Date, dt) == 0)
08.            {
09.                //Set the CssClass property to visually distinguish your special days.
10.                e.TimeSlot.CssClass = "Disabled";
11.            }
12. 
13. 
14. 
15. 
16.        }
17. 
18.          
19.        List<Resource> resources = new List<Resource>(apertureAppointments.Resources.GetResourcesByType("Managers"));
20.        Resource res = resources[5];
21. 
22.        DateTime dt1 = DateTime.Parse("2016/03/25 10:00");
23.        DateTime dt2 = DateTime.Parse("2016/03/25 16:00");
24.        if (res.Text == "Adam Adair")
25.        {
26.            if (DoDateRangesOverlap(e.TimeSlot.Start, e.TimeSlot.End, dt1, dt2))
27.            {
28.                e.TimeSlot.CssClass = "UnavailableCssStyle";
29.            }
30.        }
31.    }

 

 

This is the last element of a long running project and if can get this working they will be very please is their anyway to add a icon to represent a holiday?.

 

Veselin Tsvetanov
Telerik team
 answered on 30 Mar 2016
1 answer
138 views

Hi,

I want to show media list in Repeater, but it's not working.

I have tried to set file name static,t works out of the Repeater.

 

This is code is not working;

<form id="form1" runat="server">
    
  <telerik:RadScriptManager ID="RadScriptManager4" runat="server" EnablePageMethods="true" >
    </telerik:RadScriptManager>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Windows7" >
    </telerik:RadSkinManager>
    <asp:Repeater ID="rpDetay" runat="server" OnItemDataBound="FormatearPublicaciones">
    <ItemTemplate>
        <div>   
               
    <telerik:RadMediaPlayer RenderMode="Lightweight" ID="RadMediaPlayer1" runat="server" Width="700px" BackColor="Black"
                         AutoPlay="false" HDActive="false" Height="394px" HDSource="files/xxx.mp4" Source="files/xxx.mp4">
        </telerik:RadMediaPlayer>
        
    </div>
    </ItemTemplate>
    <SeparatorTemplate>
        <br />
    </SeparatorTemplate>
    </asp:Repeater>

    </form>

 

Also I see that errors on Chrome Developer Tools;

 

 

 

RadMediaPlayerScripts.js:1031 Uncaught TypeError: Cannot read property 'get_element' of null

RadMediaPlayerScripts.js:770 Uncaught TypeError: Cannot read property 'setBytesLoaded' of null

RadMediaPlayerScripts.js:764 Uncaught TypeError: Cannot read property 'setProgressRailMaxValue' of null

 

This code is working;

 

<form id="form1" runat="server">
    
  <telerik:RadScriptManager ID="RadScriptManager4" runat="server" EnablePageMethods="true" >
    </telerik:RadScriptManager>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Windows7" >
    </telerik:RadSkinManager>
   
         <telerik:RadMediaPlayer RenderMode="Lightweight" ID="RadMediaPlayer1" runat="server" Width="700px" BackColor="Black"
                         AutoPlay="false" HDActive="false" Height="394px" HDSource="files/xxx.mp4" Source="files/xxx.mp4">
        </telerik:RadMediaPlayer>
        
    </form>

 

 

Uncaught TypeError: Cannot read property 'get_element' of null     RadMediaPlayerScripts.js:1031 

Uncaught TypeError: Cannot read property 'setBytesLoaded' of null       RadMediaPlayerScripts.js:770 

Uncaught TypeError: Cannot read property 'setProgressRailMaxValue' of null        RadMediaPlayerScripts.js:764 

Uncaught TypeError: Cannot read property 'get_element' of null     RadMediaPlayerScripts.js:1031 

Uncaught TypeError: Cannot read property 'setBytesLoaded' of null       RadMediaPlayerScripts.js:770 

Uncaught TypeError: Cannot read property 'setProgressRailMaxValue' of null        RadMediaPlayerScripts.js:764 

Eyup
Telerik team
 answered on 30 Mar 2016
1 answer
68 views
In one of the scenarios we have a grid with horizontal scroll and in the grid last column have telerik calendar (RadDatePicker), when clicking on calendar icon calendar is not visible completely. Can we set the position to make sure come it is visible properly. This is the same case with Filter dropdown as well.
Viktor Tachev
Telerik team
 answered on 30 Mar 2016
1 answer
91 views

We are using latest version of licensed DLL 2016.1.225.35.

Editor Dialogues(Image uploader, link manager, document manager) does not close in all IE versions onclick of Cancel and insert button. whereas this works fine in other browsers.

We are enforcing to load edge version and there are no script errors on pageload?

Should we include any JS files or did we miss any reference files.

  <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadSkinManager runat="server" RenderMode="Lightweight" ID="RadSkinManager1" ShowChooser="true" Skin="Outlook" EnableEmbeddedSkins="true" Visible="false"></telerik:RadSkinManager>  
            <telerik:RadEditor RenderMode="Lightweight" ID="editor1" runat="server" EnableResize="false" EditModes="Design,HTML"
                    AllowThumbGeneration=true
                    UseEmbeddedScripts=false
                    EnableTab="false" width="630px" height="570"
                    Editable="True"
                    RadControlsDir="~/login/sites/editor/telerik/RadControls/"
                    ConfigFile="~/Login/sites/Editor/telerik/RadControls/Editor/ConfigFile.xml"
                    ToolsFile="~/Login/sites/Editor/telerik/RadControls/Editor/ToolsFile.xml"
                    ExternalDialogsPath="~/login/sites/editor/telerik/RadControls/Editor/EditorDialogs"                        
                    OnClientLoad="onClientLoad" EnableEmbeddedSkins ="true">

            </telerik:RadEditor>

 

 

Misho
Telerik team
 answered on 30 Mar 2016
2 answers
137 views
I'm trying to achive this scenario.

 

I have a RadDropDownTree using persistence framework to retain the selected combo value. My code is below.

When a user visits my page, the persistence framework correctly pulls the correct RadDropDownTree1.SelectedValue from the cookie and restores the RadDropDownTree as I expect. The issue is when I try to read RadDropDownTree1.SelectedValue after calling loadState in my code below (highlighted in bold) the value is always empty "". I presume this is due to a timing issue? What would be the correct way to do this?
 
 
private static readonly string CookieName = "TestCookie";
 
protected void Page_Init(object sender, EventArgs e)
{
    RadPersistenceManager1.StorageProviderKey = CookieName;
    RadPersistenceManager1.StorageProvider = new CookieStorageProvider(CookieName);
}
 
 
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
 
 
        if (Request.Cookies[CookieName] != null)
        {
            RadDropDownTree1.DataBind();
            RadPersistenceManager1.LoadState();
            Label1.Text = RadDropDownTree1.SelectedValue;
        }
    }
     
}
 
protected void RadDropDownTree1_EntriesAdded(object sender, DropDownTreeEntriesEventArgs e)
{
    //save selections
    RadPersistenceManager1.SaveState();
}
Lee
Top achievements
Rank 1
 answered on 29 Mar 2016
3 answers
106 views

I have a report viewer in a radgrid and the MetroTouch skin messes up the style of the report viewer and makes it look terrible.

How do I get the report viewer to display properly inside a MetroTouch skinned grid?
Maria Ilieva
Telerik team
 answered on 29 Mar 2016
3 answers
251 views

I am implementing a RadGrid that lists admin information messages.  Each row has a row delete X and I have a Remove All button.  The single row deletes work fine but the Remove All gives after the delete.

[ArgumentOutOfRangeException: capacity was less than the current size.
Parameter name: value]
   System.Collections.ArrayList.set_Capacity(Int32 value) +11392869
   Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray, Boolean shouldClearDataKeys) +450
   Telerik.Web.UI.GridTableView.GetJsonData(Int32 startRowIndex, Int32 maxRowsCount) +1013
   Telerik.Web.UI.RadGrid.InitializeDesktopGridTableViewData(GridTableView tableView, Dictionary`2 data) +2181
   Telerik.Web.UI.RadGrid.InitializeGridTableViewData(GridTableView tableView) +105
   Telerik.Web.UI.RadGrid.InitializeGridTableViewsRecursive(GridTableView tableView) +95
   Telerik.Web.UI.RadGrid.DescribeProperties(IScriptDescriptor descriptor) +4419
   Telerik.Web.UI.RadGrid.DescribeComponent(IScriptDescriptor descriptor) +49
   Telerik.Web.UI.RadCompositeDataBoundControl.Telerik.Web.IControl.DescribeComponent(IScriptDescriptor descriptor) +42
   Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(Control control) +210
   Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(WebControl control) +36
   Telerik.Web.UI.RadCompositeDataBoundControl.GetScriptDescriptors() +35
   Telerik.Web.UI.RadCompositeDataBoundControl.System.Web.UI.IScriptControl.GetScriptDescriptors() +51
   System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) +490
   System.Web.UI.ScriptManager.RegisterScriptDescriptors(IScriptControl scriptControl) +55
   Telerik.Web.UI.RadCompositeDataBoundControl.RegisterScriptDescriptors() +83
   Telerik.Web.UI.RadCompositeDataBoundControl.RenderContents(HtmlTextWriter writer) +67
   Telerik.Web.UI.RadGrid.RenderContents(HtmlTextWriter writer) +102
   Telerik.Web.UI.GridBaseDataList.Render(HtmlTextWriter writer) +132
   Telerik.Web.UI.RadGrid.Render(HtmlTextWriter writer) +217
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66  ... lots more ...

I am creating my grid completely from C# code with a very minimal grid definition in the . The remove all looks like this.

protected void RemoveAll_Click(object sender, EventArgs e)
{
    HomeGrid.DataSource = null;
    DataService.Factory().RemoveAllMessages(user.orgId);   
    HomeGrid.Rebind();
}

This is my grid definition without the columns

RadGrid adminGrid = HomeGrid;
adminGrid.NeedDataSource += new GridNeedDataSourceEventHandler(AdminGrid_NeedDataSource);
adminGrid.Skin = "Default";
adminGrid.AutoGenerateColumns = false;
adminGrid.EnableViewState = false;
adminGrid.GroupingEnabled = false;
adminGrid.AllowPaging = true;
adminGrid.PageSize = 500;
adminGrid.Height = Unit.Percentage(100);
adminGrid.EnableHeaderContextMenu = true;
adminGrid.AllowSorting = true;
adminGrid.AllowFilteringByColumn = true;
adminGrid.AllowMultiRowSelection = false;
adminGrid.AllowAutomaticDeletes = true;
adminGrid.ClientSettings.EnableRowHoverStyle = true;
adminGrid.ClientSettings.Selecting.AllowRowSelect = true;
adminGrid.ClientSettings.Selecting.EnableDragToSelectRows = true;
adminGrid.ClientSettings.ReorderColumnsOnClient = true;
adminGrid.ClientSettings.AllowColumnsReorder = true;
adminGrid.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Reorder;
adminGrid.ClientSettings.Virtualization.EnableVirtualization = true;
adminGrid.ClientSettings.Virtualization.InitiallyCachedItemsCount = 2000;
adminGrid.ClientSettings.Scrolling.AllowScroll = true;
adminGrid.ClientSettings.Scrolling.UseStaticHeaders = true;
adminGrid.ClientSettings.Scrolling.ScrollHeight = Unit.Percentage(100);
adminGrid.ClientSettings.Resizing.AllowColumnResize = true;
adminGrid.PagerStyle.Mode = GridPagerMode.NextPrevNumericAndAdvanced;
adminGrid.GroupingSettings.CaseSensitive = false;

and this my  RadGrid definition

<asp:panel runat="server" ID="HomeGridPanel"  CssClass="windowPercent" >
            <telerik:RadGrid runat="server" ID="HomeGrid"  OnItemCommand="HomeGrid_ItemCommand"></telerik:RadGrid>
</asp:panel>

I looked at other posts and could not figure out anything to do about this.   I added AllowAutomaticDeletes based on searches which did not help.

How can I get rid of the ArrayList ArgumentOutOfRangeException when the Grid goes from having data to no data on a Rebind()?

On removing single rows going from 1 to zero works fine but Remove All gives the error one row.  I think the difference is the single row remove is done from an OnItemCommand RadGrid call while the Remove All is done from a server button click method.

George

 

Maria Ilieva
Telerik team
 answered on 29 Mar 2016
1 answer
255 views
I have a Radgrid which is binded in codebehind and containined in modalextender .Onload , grid show this error , UserNameTitleIndexChanged not defined ,it is defined in radcombobox but still not working
<telerik:RadGrid ID="GridConsultancy" runat="server" FilterMenu-CausesValidation="false" AllowFilteringByColumn="true" AllowPaging="false" AutoGenerateColumns="false" OnNeedDataSource="GridConsultancy_NeedDataSource"  EnableLinqExpressions="false">
                                       <GroupingSettings CaseSensitive="false" />
                                       <ClientSettings>
                                           <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
                                       </ClientSettings>
                                       <MasterTableView AllowFilteringByColumn="true" NoDetailRecordsText="No Data Present" AllowSorting="true" TableLayout="Fixed">
                                           <HeaderStyle Width="120" />
                                           <Columns>
                                               <telerik:GridTemplateColumn HeaderText="Sr No." HeaderStyle-Width="70" AllowFiltering="False" AutoPostBackOnFilter="true">
                                                   <ItemTemplate>
                                                       <asp:Label ID="lb_s" runat="server" Text="<%# Container.DataSetIndex+1 %>"></asp:Label>
                                                   </ItemTemplate>
                                               </telerik:GridTemplateColumn>
                                               <telerik:GridDateTimeColumn DataField="EntryDate" UniqueName="EntryDate" HeaderText="Entry Date" HeaderStyle-Width="110" FilterControlWidth="100px" DataType="System.DateTime"
                                                   SortExpression="EntryDate" EnableTimeIndependentFiltering="true" AutoPostBackOnFilter="true"
                                                   DataFormatString="{0:dd MMM yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo">
                                               </telerik:GridDateTimeColumn>
                                                 <telerik:GridBoundColumn DataField="UserName" HeaderText="UserName" UniqueName="UserName"
                           FilterControlWidth="110" HeaderStyle-Width="120" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                           ShowFilterIcon="false">
                           <FilterTemplate>
                               <telerik:RadComboBox ID="UserNameRadComboBoxTitle5" Width="110" Style="z-index: 10000001"
                                   runat="server" DataTextField="UserName" DataValueField="UserName"
                                   OnClientSelectedIndexChanged="UserNameTitleIndexChanged" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("UserName").CurrentFilterValue %>'>
                                   <Items>
                                       <telerik:RadComboBoxItem Text="Select" />
                                       <telerik:RadComboBoxItem Text="All" Value="" />
                                       <telerik:RadComboBoxItem Text="Tim" Value="Tim" />
                                       <telerik:RadComboBoxItem Text="Jeorge" Value="Jeorge" />
                                    
                                   </Items>
                               </telerik:RadComboBox>
                               <telerik:RadScriptBlock ID="UserNameRadScriptBlock" runat="server">
                                   <script type="text/javascript">
                                       function UserNameTitleIndexChanged(sender, args) {
                                           var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                                   tableView.filter("UserName", args.get_item().get_value(), "Contains");
                                                               }
                                   </script>
                               </telerik:RadScriptBlock>
                           </FilterTemplate>
                       </telerik:GridBoundColumn>
                                           </Columns>
                                       </MasterTableView>
                                   </telerik:RadGrid>
Viktor Tachev
Telerik team
 answered on 29 Mar 2016
3 answers
120 views

Hi,

We are using ribbon-button and in which we are shorting its name after curtain length e.g xyz... . We see Tooltip by hovering over there , in that also we same text with Ellipsis but there we want full text. So can you please suggest  or tell us how we can achieve that .

Attached Snap shot.

Magdalena
Telerik team
 answered on 29 Mar 2016
0 answers
205 views

I am trying to Implement IBindableTemplate for creating custom Edit Template in Batch Edit Mode. Not able to implement the ExtractValues method of IBindableTemplate interface correctly. When I assign the Control.ID in InstantiateIn() method then i am getting the following error. Without  this control ID how to get the values in ExtractValues() method.

System.Web.HttpException: Multiple controls with the same ID 'DepartmenCode' were found. FindControl requires that controls have unique IDs.   
 at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls)    
 at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls)    
 at System.Web.UI.Control.FindControl(String id, Int32 pathOffset)    
 at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)    
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

protected override void OnInit(EventArgs e)
        {
RadGrid theGrid = new RadGrid();
                    theGrid.ID = this.ID + "Grid";
                    theGrid.AutoGenerateColumns = false;
theGrid.NeedDataSource += new GridNeedDataSourceEventHandler(theGrid_NeedDataSource);
                    theGrid.DetailTableDataBind += new GridDetailTableDataBindEventHandler(theGrid_DetailTableDataBind);
                    theGrid.SortCommand += new GridSortCommandEventHandler(theGrid_SortCommand);
                    theGrid.ItemDataBound += new GridItemEventHandler(theGrid_ItemDataBound);
                    theGrid.DataBound += new EventHandler(theGrid_DataBound);
                    theGrid.PreRender += new EventHandler(theGrid_PreRender);
                    theGrid.PageIndexChanged += new GridPageChangedEventHandler(theGrid_PageIndexChanged);
                    //Batch Edit Mode Start 
                    theGrid.BatchEditCommand += new GridBatchEditEventHandler(theGrid_BatchEditCommand);
                    
                    theGrid.MasterTableView.EditMode = GridEditMode.Batch;
                    theGrid.MasterTableView.BatchEditingSettings.EditType = GridBatchEditingType.Row;
                    theGrid.MasterTableView.BatchEditingSettings.OpenEditingEvent = GridBatchEditingEventType.DblClick;
                    theGrid.MasterTableView.BatchEditingSettings.SaveAllHierarchyLevels = true;
                    theGrid.MasterTableView.CommandItemSettings.ShowSaveChangesButton = true;
                    theGrid.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false;
                    theGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottom;
                    theGrid.ShowHeader = true;
                    theGrid.MasterTableView.CommandItemSettings.ShowCancelChangesButton = true;
                    //Batch Edit Mode End 

SetupGridColumns();
}

private void SetupGridColumns(){
 
foreach (XmlElement displayField in DisplayFields)
            {
SetupGridColumn(displayField)
}

}


 private void SetupGridColumn(fieldName){
GridTemplateColumn col=new GridTemplateColumn();
                
                SPField field = TopList.Fields[fieldName];
                col.ItemTemplate = new DataGridEditTemplate(ListItemType.Item, fieldName, fieldInternalName, field, theGrid, listView.Utility);
                col.EditItemTemplate = new DataGridEditTemplate(ListItemType.EditItem, fieldName,fieldInternalName, field, theGrid, listView.Utility);
                col.DataField = fieldInternalName;
GridTableView.Columns.Add(col);
}

 private void theGrid_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
        {
            foreach (GridBatchEditingCommand command in e.Commands)
            {
                if ((command.Type == GridBatchEditingCommandType.Update))
                {
                    Hashtable newValues = command.NewValues;
                    Hashtable oldValues = command.OldValues;
                    string ID = newValues["ID"].ToString();
                    //string Name = newValues["Name"].ToString();

                    try
                    {
                        SPList list = SPContext.Current.Web.Lists.TryGetList("Department");
                        SPListItem item = list.GetItemById(Convert.ToInt32(ID));
                        foreach (DictionaryEntry entry in newValues)
                        {
                            if ((string)entry.Key != "ID")
                            {
                                item[(string)entry.Key] = entry.Value;
                            }
                        }
                        item.Update();

                    }
                    catch (Exception exc)
                    {

                        Logger.Log(TraceSeverity.High, this.PageUrl, this.Title, this.CurrentUserName, exc.Message, exc.StackTrace);
#if DEBUG
                        ErrorMessage = Utility.GetMessage(WADataViewerConstant.ResourceNamespace, "ERROR_OCCURED", exc.ToString());
#else
                ErrorMessage = Utility.GetMessage(WADataViewerConstant.ResourceNamespace, "ERROR_OCCURED", exc.Message);
#endif
                        e.Canceled = true;
                    }
                }
            }
        }

public class DataGridEditTemplate : IBindableTemplate
    {
        ListItemType _templateType; 
        string columnName;
        SPField _spField;
        RadGrid _theGrid;
        bool isAutoPostBack;
        string _fieldInternalName;
        WAUtility _Utility;
        public DataGridEditTemplate(ListItemType templateType, string colname, string fieldInternalName, SPField field, RadGrid grid, WAUtility Utility)
        {
            _templateType = templateType;
            columnName = colname;
            _fieldInternalName = fieldInternalName;
            _spField = field;
            _theGrid = grid;
            _Utility = Utility;
        }

        public void InstantiateIn(System.Web.UI.Control container)
        {
            Label lc = new Label();
            switch (_templateType)
            {
              
                case ListItemType.Item:
                   // lc.Text = "Item " + _fieldInternalName;
                    lc.DataBinding += new EventHandler(lControl_DataBinding);
                    //lc.ID =_fieldInternalName;
                    container.Controls.Add(lc);
                    break;
                case ListItemType.EditItem:
                  
                    container.Controls.Add(GetControlByFieldType(_spField, null));
                    break;
                  
            }
        }
        public void lControl_DataBinding(object sender, EventArgs e)
        {
            Label l = (Label)sender;
            GridDataItem container = (GridDataItem)l.NamingContainer;
            l.Text = ((DataRowView)container.DataItem)[_fieldInternalName].ToString();
        }

private Control GetControlByFieldType(SPField field)
        {
            Control fieldControl = null;
            BaseFormControl basefc = null;

            string validationGroup = field.Id + "ValidationGroup";
            string mask = null;
            string promptCharacter = null;

            bool editable = !field.ReadOnlyField; 
            //bool autoPostBack = IsAutoPostbackField(fieldNode);

            switch (field.Type)
            {
                case SPFieldType.Text:
                    #region -------------Text---------------------- 
                    SPFieldText fieldText = (SPFieldText)field;

                    TextFieldControl tfc = new TextFieldControl();
                    basefc = tfc;
                    tfc.ID = _fieldInternalName;
                    tfc.ContainerID = validationGroup;
                    tfc.Mask = mask;
                    tfc.PromptCharacter = promptCharacter;
                    tfc.FieldMaxLength = fieldText.MaxLength;
                    tfc.FieldDisplaySize = fieldText.DisplaySize;
                    tfc.FieldIMEMode = fieldText.IMEMode;
                    tfc.Editable=editable;
                    fieldControl = tfc;

                    break;
                    #endregion -------------Text---------------------- 
}
}

  public System.Collections.Specialized.IOrderedDictionary ExtractValues(System.Web.UI.Control container)
        {
            System.Collections.Specialized.OrderedDictionary od = null;
            //od.Add("OrderID", ((DropDownList)(((GridEditFormItem)(container)).FindControl("dropdownlist1"))).DataValueField);
            //if (container is GridDataItem)
            //{
            //    GridDataItem dataItem = container as GridDataItem;
            //}
            //if (container is GridEditFormItem)
            {
                od = new System.Collections.Specialized.OrderedDictionary();
                //od.Add(_fieldInternalName, ((DropDownList)(((GridEditFormItem)(container)).FindControl("_fieldInternalName"))).DataValueField);
                //Control ctrl = ((container)).FindControl("_fieldInternalName");

                foreach (Control ctrl in container.Controls)
                {
                    if (ctrl.Controls.Count > 0)
                    {
                        Type ctrlType = ctrl.Controls[0].GetType();
                        if (ctrlType == typeof(DropDownList))
                        {
                            od.Add(ctrl.Controls[0].UniqueID, ((DropDownList)(ctrl.Controls[0])).DataValueField);
                        }
                        if (ctrlType == typeof(TextBox))
                        {
                            od.Add(ctrl.Controls[0].UniqueID, ((TextBox)(ctrl.Controls[0])).Text);
                        }
                        if (ctrlType == typeof(Label))
                        {
                            od.Add(ctrl.Controls[0].UniqueID, ((Label)(ctrl.Controls[0])).Text);
                        }
                    }
                }
            }
            
            
            return od;
        }
    }
Abhishek
Top achievements
Rank 1
 asked on 29 Mar 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?