Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
410 views

I have built a RadGrid with a MultiColumn ComboBox nested in an EditItemTemplate column This is the ASP code for the ComboBox.  I based my design from the Telerik example from this Demo-Site

<EditItemTemplate>
                                           <telerik:RadComboBox RenderMode="Lightweight" runat="server" ID="RadComboBox1" EnableLoadOnDemand="True"
                                                   DataTextField="FullName" OnItemsRequested="RadComboBox1_ItemsRequested" DataValueField="EID" AutoPostBack="true"
                                                   HighlightTemplatedItems="true" Height="140px" Width="220px" DropDownWidth="420px"
                                                   OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
                                   <HeaderTemplate>
                                       <ul>
                                           <li class="col1">EID</li>
                                           <li class="col2">FullName</li>
                                       </ul>
                                   </HeaderTemplate>
                                    
                               </telerik:RadComboBox>
                                       </EditItemTemplate>

 

And this is the C# code behind for the Combo

protected void RadComboBox1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            string sql = "SELECT [EID], [FullName] from LU_Employees  WHERE FullName LIKE @FullName + '%'";
            SqlDataAdapter adapter = new SqlDataAdapter(sql,
                ConfigurationManager.ConnectionStrings["DatabaseLatentFingerpints"].ConnectionString);
            adapter.SelectCommand.Parameters.AddWithValue("@FullName", e.Text);
            DataTable dt = new DataTable();
            adapter.Fill(dt);
 
            RadComboBox comboBox = (RadComboBox)sender;
            // Clear the default Item that has been re-created from ViewState at this point.
            comboBox.Items.Clear();
 
            foreach (DataRow row in dt.Rows)
            {
                RadComboBoxItem item = new RadComboBoxItem();
                item.Text = row["FullName"].ToString();
                item.Value = row["EID"].ToString();
                item.Attributes.Add("FullName", row["EID"].ToString());
 
                comboBox.Items.Add(item);
 
                item.DataBind();
            }
 
        }

 

The comboBox works but I now need to solve the problem of showing the Selected Item when I am editing the record.  Right now when I click the edit button the ComboBox  is blank.  I read the Telerik information at This link and here is the code I used for the OnItemDataBoundHandler method;

protected void OnItemDataBoundHandler(object sender, GridItemEventArgs e)
        {
            if (e.Item.IsInEditMode)
            {
                GridEditableItem item = (GridEditableItem)e.Item;
                if (!(e.Item is IGridInsertItem))
                {
                    RadComboBox combo =
                          (RadComboBox)item.FindControl("RadComboBox1");
                    RadComboBoxItem preselectedItem = new RadComboBoxItem();
                    preselectedItem.Text = item["FullName"].Text;
                    preselectedItem.Value = item["EID"].Text;
                    combo.Items.Insert(0, preselectedItem);
                    combo.SelectedIndex = 0;
 
                }
            }
        }

 

When I run the app and click the edit link to to edit the record I get an error message When the code line "preselectedItem.Text = item["FullName"].Text;" runs.  I have taken a screen shot of the error and have attached for your review

 

Can someone please tell me what I have done wrong with this code?

Perry
Top achievements
Rank 1
 answered on 16 May 2019
1 answer
119 views

Has anyone else had to deal with this or have any recommendations for a workaround?

There is a bug with the editor that is causing it to append multiple elements with the same id.

This is reproducible in latest example pages here: https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

Steps to reproduce:

  1. Create a div(or h2, etc) element with an id in the html editor e.g. <div id="test">This id will be duplicated</div>
  2. Swap to design mode and click after the div or element you added and hit enter any number of times.
  3. Each new paragraph that is created has the id of its previous sibling e.g. <p id="test">&nbsp;</p>

This is very frustrating for content creators trying to link to sections of a document and it is obviously not valid HTML.

Rumen
Telerik team
 answered on 16 May 2019
2 answers
192 views

Dears 

  I'm confused about my Group Header, why it's generate in div, but not span like the Demos do? 

Can anyone help me what makes the different? thank you!

this is my code : 

<telerik:RadGrid ID="RadCompanyGrid" runat="server" AllowPaging="False" AutoGenerateColumns="False" Width="100%" MasterTableView-TableLayout="Fixed" MasterTableView-HorizontalAlign="Center" OnItemDataBound="RadCompanyGrid_ItemDataBound" Skin="Default" >  
                        <ClientSettings >
                            <Scrolling UseStaticHeaders="true" AllowScroll="true" />
                            <ClientEvents OnGridCreated="RadCompanyGridCreated" />                            
                        </ClientSettings>                        
                        <GroupingSettings GroupByFieldsSeparator=" " />
                        <MasterTableView Width="100%" Caption="2018å¹´02月指定目標檢討" GroupHeaderItemStyle-Wrap="true"  EnableGroupsExpandAll="true" >   
                            <GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <SelectFields>  
                                        <telerik:GridGroupByField FieldAlias="Category" FieldName="Category" HeaderText=" " HeaderValueSeparator=" " />
                                        <telerik:GridGroupByField FieldAlias="Count" Aggregate="Count" FieldName="No" FormatString="({0} Items)" HeaderText=" " HeaderValueSeparator=" " /> 
                                    </SelectFields>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldName="Category" SortOrder="Descending" />
                                    </GroupByFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
                            <Columns>
                                <telerik:GridBoundColumn DataField="No" FilterControlAltText="Filter 編號" HeaderText="編號" UniqueName="編號" >
                                    <HeaderStyle Width="8%" Wrap="False" HorizontalAlign="Center"  />
                                    <ItemStyle Width="8%" Wrap="False" HorizontalAlign="Left"  />
                                </telerik:GridBoundColumn>                                                            
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>

 

It's show up like MyGrid.png , But Demo's Grid show up like Demo.png.

 

 

Vera Fang
Top achievements
Rank 1
 answered on 16 May 2019
1 answer
198 views

Im tring to change the default width of my raddropdownlist but nothing changes it.

the list's width changes but the control stays the same.

How can I change it?

 

thanx

 

<telerik:raddropdownlist id="ddlprok" runat="server" width="300px" dropdownwidth="300px">.........</telerik:raddropdownlist>
Rumen
Telerik team
 answered on 16 May 2019
4 answers
382 views

Hi all,

i am in project, now i am in critical phase..

my scenario : Radgrid needs to refresh at regular interval, but not whole grid, it should refresh particular columns.

 In Details:

Consider

B1 is buyer1

B2 is buyer2 and so on.

S is seller.

S(Seller) wants to sell a product through online and he can Negotiate Rate to different Buyer(B1,B2 and so on) at same time.

i am using grid control to display Buyers details to seller

Grid Contain:

Sellers's Grid
Buyer Name*, Product Name*, Product's First Rate*, Seller's Rate**, Buyer Rate*$
Buyer's Grid
Seller Name*, Product Name*, Product's First Rate*, ​Buyer's Rate**, Seller Rate*$​

* --> Label

** --> Textbox

$ --> Columns needs to refresh

Seller will entry his rate in Seller's Rate in Grid, after entering the rate immediately it should be display in Buyers Gird(Seller Rate Column).

i can able to fetch the rate in grid, using timer control. the problem is, it refresh whole grid.

while seller trying to enter rate in grid, due to refresh of grid, Seller not able to enter rate at the time of timer control triggers.

 

it is possible to refresh particular column in grid without affecting other columns. 

Most importantly, it is possible refresh the Buyer Rate column and enter the value in Seller's Rate column at same time in Seller's Grid.

 

It you have solution,help me

 Thanks in Advance.

 

Regars

ASRK.....

Attila Antal
Telerik team
 answered on 16 May 2019
0 answers
185 views
Our Requirements
How to consider following requirements?
Case 1 - How to manage different time slots for single resource?
Example 10 minutes slot between 8AM to 12PM and 20 minutes slot between 2PM and 6PM.

Case 2 - How to manage different time slots resource wise? 
Example 10 minutes slot for resource1 and 20 minutes slot for resource2.


Solution adopted to achieve requirement 1 (II) i.e. Case 2

I have some issues in Rad Scheduler for binding in run time and create events, bind menu and perform same as static control which add in design page (normal activity). 
In this case may be more than one Schedulers require to bind in panel control to display differently.

Binding Rad Scheduler in run time and create event like time slot contact menu and appointment slot menu click. Below code are events I created in run time:
RadScheduler.AppointmentContextMenuItemClicked += new AppointmentContextMenuItemClickedEventHandler(RadScheduler1_AppointmentContextMenuItemClicked);

RadScheduler.TimeSlotContextMenuItemClicked += new TimeSlotContextMenuItemClickedEventHandler(RadScheduler1_TimeSlotContextMenuItemClicked);

RadScheduler.TimeSlotCreated += new TimeSlotCreatedEventHandler(RadScheduler1_TimeSlotCreated);
Event is fire when click in menu but not reach in mention event name like click in time slot menu (RadScheduler1_TimeSlotContextMenuItemClicked). Binding menu is ok by dynamic.  These events are fired in static control which added in design page. One thing all events and activities are working fine in static control. 
Our telerik version is very old. I can't remember version.


Please help us as soon as possible.


Regards,
Jiten Mutum
Jiten
Top achievements
Rank 1
 asked on 16 May 2019
3 answers
145 views

Hi,

When I was using RadNumericTextBox, I got an error window when LMB is up over a spin button.

When I pressed LMB on increase/decrease buttons and held LMB without releasing it, everything was OK. The corresponding value could be changed correctly.

But when LMB was released, an error message box poped up. At that time, there is no postback yet. So I think the error raised from client.

I do not know which event raised when LMB is up over a spin button, so I am not able to  trace the error.

Could you provide me some ideas about how to investigate some kind of issue?

Thanks

Best regards

Zhang Rui

Rumen
Telerik team
 answered on 15 May 2019
4 answers
132 views

Hello Team,

 

Am expecting PivotGrid to display value into following order 1, 2, 12 and then 1011 but PivotGrid is displaying them into 1, 1011, 12 and then 2.

How can this be fixed?

 

Thanks,

Mohan

 

Attila Antal
Telerik team
 answered on 15 May 2019
4 answers
442 views

I have an issue while doing custom sorting( PivotGridSortOrder.None) on pivot grid using multiple columns. 

Issue: Want to use custom sorting for pivotgrid control.
* I have set both the row field (Country field) and column field (StateCode) to PivotGridSortOrder.None so that it does not use ascending or descending sorting instead it will use sorting as per data set provided.
* For country field(Row field) I have following values : Japan, Argentina, Zimbabwe and India, I want pivot grid to display them in same order too and it is working fine.
* For StateCode field (column field), I have following values: Mno, Abc, Zmp and Ctp and I want pivot grid to display them in this order only. But it is not.

* Dataset being returned by SP is attached. refer screenshot.

* Data being displayed on pivot is attached, refer screenshot.

Let me know how to fix it.

Mohan
Top achievements
Rank 1
 answered on 15 May 2019
3 answers
229 views

Hello.....

how to add Column Group for code behigh vb.net

- I Can  pic1.png
 - I want pic2.png

 

 

Vessy
Telerik team
 answered on 14 May 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?