Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
158 views
Hi ,

I need some custom changes to be done on the current  RadCombo features:
1. Assuming I have a RadCombo with checkboxes and the list of items are
[ ] No Preferences
[ ] Product 1
[ ] Product 2
[ ] Product 3

When I check No Preferences (Index 0) , All already selected Items should be unchecked... Conversely, If I check One of the item from Product 1 - 3, It should uncheck No Preference.

2. Also, When I click on the Description, it should check and uncheck the checkbox...

3. The CheckedItemsText when It is "Display All In Input"... I need to show the whole String as long as it would fit within the Width of the Combo and if it exceeds certain length, I would like to truncate the string and append "..." at the end

Can anyone point me to where I can find information on how to access the checked elements, the CheckedItemText property within the RadCOmbo to achieve such a requirement using ClientSide Javascript?

Thanks
Kalina
Telerik team
 answered on 17 Jan 2012
5 answers
386 views
I've implemented a RadListBox which will almost always have more items than will stack vertically, thus there's almost always a scrollbar.  For reasons I've explained in other threads, my application requires that a single-click and a double-click cause a server-side postback.  That part of the equation has long been built and is working fine.

Where I've run into a problem is the age-old issue of selecting a ListBox item near the bottom, having the postback occur, and then the ListBox item no longer in exactly the same vertical position it was before and often not even visible.  I've read several threads in this forum addressing this problem and have come up with this solution of my own:

In the server-side method that handles selecting a listbox item, I added this code:

      Page page = HttpContext.Current.CurrentHandler as Page;<br>      ScriptManager.RegisterStartupScript(page, page.GetType(), Guid.NewGuid().ToString(), "setTimeout(function() {scrollIntoView()}, 100);", true);

Which in turns executes this code on the client after the postback is done:

  function scrollIntoView() {<br>    var slidingZone = $find($('table[id$=_radSlidingZone]')[0].id);<br>    var slidingPane = slidingZone.getPanes()[0];<br>    var listBox = $find($("#" + slidingPane.get_id() + " div[id$=_radListBoxStopes]")[0].id);<br><br>    var item = listBox.get_selectedItem();<br>    if (item != null)<br>      item.scrollIntoView();<br>  }

It seems to be working "okay" but I'm just wondering if, in 2012, this is the best/easiest way to solve this problem or whether there's a simpler/better approach?

Thank you,

Robert



Dimitar Terziev
Telerik team
 answered on 17 Jan 2012
0 answers
144 views

 

Hi,
I have a grid that is populated in the event NeedDataSource when the page is loaded. When selecting an item from a combo, the other is a populated combo, and now gives an error 500.
I did several tests and when I populate the grid with up to 41 records, works, but if my grid has more than 41 records this error occurs ...
This grid has image and textbox in the ItemTemplate ...
Can anyone help me urgently?

Error:

Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3apt-BR%3a553a4a13-b3a5-4e6b-a152-b131051f1788%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.701.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3apt-BR%3a7e598a31-3beb-49a1-914c-5f530240f0ea%3a16e4e7cd%3af7645509%3a24ee1bba%3ae330518b%3a1e771326%3ac8618e41%3aed16cbdc%3a874f8ea2%3a19620875%3a33108d14%3abd8f85e4%3a58366029%3aaa288e2d%3ae4f8f289, line 15 character 9936

Camila Foltran
Top achievements
Rank 1
 asked on 17 Jan 2012
2 answers
185 views

Hi,
I am Currently working on GridDropdownlist column ,here am trying to bind datasource  to the GridDropdown column in the Item DataBound event.But it is coming as empty..Please suggest me ,where am i doing wrong.

Here is my Code:

ASPX

 

 

<asp:UpdatePanel runat="server">

 

 

 

<ContentTemplate>

 

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"

 

 

 

OnItemDataBound="RadGrid1_ItemDataBound" GridLines="None">

 

 

 

<MasterTableView AutoGenerateColumns="False">

 

 

 

<EditFormSettings ColumnNumber="2" CaptionFormatString="Edit details for ProductName with ID {0}"

 

 

 

CaptionDataField="DeptName">

 

 

 

<FormTableItemStyle Wrap="False"></FormTableItemStyle>

 

 

 

<FormCaptionStyle></FormCaptionStyle>

 

 

 

<FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />

 

 

 

<FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"

 

 

 

Height="110px" Width="100%" />

 

 

 

<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>

 

 

 

<FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>

 

 

 

<EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">

 

 

 

</EditColumn>

 

 

 

<FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>

 

 

 

</EditFormSettings>

 

 

 

<Columns>

 

 

 

<telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>

 

 

 

 

<telerik:GridRatingColumn DataField="Rating" HeaderText="Rating">

 

 

 

<HeaderStyle Width="250px" />

 

 

 

</telerik:GridRatingColumn>

 

 

 

<telerik:GridAttachmentColumn MaxFileSize="1048576" EditFormHeaderTextFormat="Upload File:"

 

 

 

HeaderText="Download" AttachmentDataField="BinaryData" FileNameTextField="AttachmentFile"

 

 

 

DataTextField="AttachmentFile" UniqueName="AttachmentFile">

 

 

 

</telerik:GridAttachmentColumn>

 

 

 

<telerik:GridDropDownColumn UniqueName="DeptName" DataField="DeptName" ListTextField="DeptName" ListDataMember="DeptName"

 

 

 

SortExpression="DeptName" DropDownControlType="DropDownList" HeaderText="RadComboBox Column">

 

 

 

</telerik:GridDropDownColumn>

 

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

 

</ContentTemplate>

 

 

 

</asp:UpdatePanel>

 


C#

private

 

 

DataTable BindData()

 

{

 

 

DataTable dt = new DataTable();

 

 

 

DataColumn dc = new DataColumn("Rating");

 

dt.Columns.Add(dc);

 

 

DataColumn dc1 = new DataColumn("AttachmentFile");

 

dt.Columns.Add(dc1);

 

 

DataColumn dc2 = new DataColumn("DeptName");

 

dt.Columns.Add(dc2);

 

 

DataRow dr = dt.NewRow();

 

dr[dc] = 3.5;

dr[dc1] =

 

"Image1";

 

dr[dc2] =

 

"HR";

 

dt.Rows.Add(dr);

 

 

return dt;

 

}


protected

 

 

void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

 

{

RadGrid1.DataSource = BindData();

 

}

 

 

protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)

 

{

 

 

 

if (e.Item is GridEditableItem && e.Item.IsInEditMode)

 

{

 

 

GridEditableItem editedItem = e.Item as GridEditableItem;

 

 

 

GridEditManager editMan = editedItem.EditManager;

 

 

 

GridDropDownListColumnEditor editor = (GridDropDownListColumnEditor)(editMan.GetColumnEditor("DeptName"));

 

 

 

DropDownList ddList = editor.DropDownListControl;

 

ddList.DataSource = AssignDataSourceToDropDown();

ddList.DataTextField =

 

"DeptName";

 

ddList.DataValueField =

 

"DeptId";

 

ddList.DataBind();

}

 

 

 

}

 

 

private DataTable AssignDataSourceToDropDown()

 

{

 

 

DataTable dt = new DataTable();

 

 

 

DataColumn dc = new DataColumn("DeptName");

 

 

 

DataColumn dc1 = new DataColumn("DeptId");

 

dt.Columns.Add(dc);

dt.Columns.Add(dc1);

 

 

DataRow dr = dt.NewRow();

 

 

dr[dc] =

 

"HR";

 

dr[dc1] =

 

"1";

 

dt.Rows.Add(dr);

 

dr = dt.NewRow();

 

dr[dc] =

 

"PF";

 

dr[dc1] =

 

"2";

 

dt.Rows.Add(dr);

 

dr = dt.NewRow();

 

dr[dc] =

 

"Admin";

 

dr[dc1] =

 

"3";

 

dt.Rows.Add(dr);

 

dr = dt.NewRow();

 

dr[dc] =

 

"TTG";

 

dr[dc1] =

 

"4";

 

dt.Rows.Add(dr);

 

 

 

return dt;

 

}


Regards,
Sreekanth

Jayesh Goyani
Top achievements
Rank 2
 answered on 17 Jan 2012
5 answers
140 views
I'm trying to achieve a different visual style within the combo box...

Notice the word "Yes" and the rest of the wording in a paler color .

Thanks
Gotcha
Top achievements
Rank 1
 answered on 17 Jan 2012
3 answers
305 views
Hello,
               
              Recently i am working with RadButton when we apply skin to it and run it. It is not diplayed properly it is Displayed like Broken
Button, i am  sending image of the button with this mail..  Pls Respond...


   
      



 
Kaushal
Top achievements
Rank 1
 answered on 17 Jan 2012
1 answer
125 views
Does anyone have any idea how I might show the current time in a timeline view?

I'm not talking about the header. I have a client who wants to see a view of the day in timeline view with a marker showing the place in the day, like this.

I know it can't be done out of the box, but I was wondering if anyone out there had any ideas about how it might be achieved.

--
Stuart
Plamen
Telerik team
 answered on 17 Jan 2012
1 answer
54 views
Hi All,

Just a bug report with the MaxHeight setting of the combobox. If one or more items in the combobox are multiline the MaxHeight fails, as it calculates assuming one line per item.

Not majorly urgent but means you need to manually set the 'Height' setting instead of using the recommended 'MaxHeight' setting.

Cheers,
- Will
Kalina
Telerik team
 answered on 17 Jan 2012
2 answers
199 views
Hello,

I have set the height of my combo in CSS but when I check the items in the dropdown I would like the items to be vertically aligned to the top of the INPUT and to wrap. Here is the CSS I am using (which does correctly set the height but does not align or wrap the selected items.
#ctl00_Main_LeadMgt1_comboGroupSIC .rcbInput
    {
        height: 40px;
        white-space: normal !important;
        vertical-align: top !important;
    }

I also attached an image that show the selected items center aligned. If I selected one more item then the input will show "5 items checked" what I would want is for the input to wrap the 5th item and then once no more items could be displayed the "5 items checked" will display.
Thank you!
Kalina
Telerik team
 answered on 17 Jan 2012
7 answers
306 views
Hello,
I'm going to implement a grid's CardView feature and create a grid from server side. This is what I do:
MasterTableView.ItemTemplate = new CardViewItemTemplate(owner.ZSheet, owner.CardLayout);
MasterTableView.EditItemTemplate = new CardViewEditItemTemplate(owner.ZSheet, owner.CardLayout);

Each template is going to contain a custom control which is actually HtmlTable descendant which contains Label controls in ItemTemplate and editor controls like TextBox and so on in EditItemTemplate. Everything is clear with ItemTemplate but in EditItemTemplate I need to implement IBindableTemplate. Any ideas of how it should be done?
I would appreciate any sample of how CardView templates are created from codebehind.
Mira
Telerik team
 answered on 17 Jan 2012
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?