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

I have two RadGrids. The first grid presents a list of items and with a push of a button selected items are transferred to the second grid (in addition to whatever might already be in the second grid). So on button's Click event (server side) I go through all items in the second grid to see what has already been added. However, the value of GridDataItem.Text is wrong (contains only  ):

foreach (GridDataItem dataItem in rgTaskDevice.Items)

 

{

 

 

 

 

Device device = new Device();

 

device.Id =

 

Convert.ToInt64(dataItem["Id"].Text); // this causes Exception because .Text = " "
//same for all other columns
...
}


Does anyone have an idea of what went wrong?

Kind regards,
Andreja

 

 


 

Andreja Zitnik
Top achievements
Rank 1
 answered on 29 Jul 2010
1 answer
248 views
Hi!
I'm facing a problem skinning my website.
I'm trying to minimize http calls so i've decide to use a custom skin called GuSkin that i build using a different project.
This project customize FormDecorator, Menu, Grid, Window and ComboBox widgets.
I'm using RadStyleSheetManager to combine all css I produced:
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" EnableStyleSheetCombine="false">
    <StyleSheets>
        <telerik:StyleSheetReference Name="GuTelerikSkins.FormDecorator.css" Assembly="GuTelerikSkins" />
        <telerik:StyleSheetReference Name="GuTelerikSkins.Menu.css" Assembly="GuTelerikSkins" />
        <telerik:StyleSheetReference Name="GuTelerikSkins.Grid.css" Assembly="GuTelerikSkins" />
        <telerik:StyleSheetReference Name="GuTelerikSkins.Window.css" Assembly="GuTelerikSkins" />
        <telerik:StyleSheetReference Name="GuTelerikSkins.ComboBox.css" Assembly="GuTelerikSkins" />
    </StyleSheets>
</telerik:RadStyleSheetManager>
As you can see the Assembly is named GuTelerikSkins, but the skin itself is named GuSkin.
The main problem comes from base css styles that telerik use. I'm trying to change font-family of a label tag as
Helvetica, Arial, sans-serif
But the base css of Telerik send a css property that override my font family (which must be common through all the website):
font-family: "Segoe  UI",Arial,Verdana,sans-serif;

For example my decorated form labels are different from the rest of the website.
I've attached 2 screenshots that describe the current styles of labels and the target styles i want to apply so that labels in editon mode are the same as readonly mode on my pages...

Is there a tip to customize base css of Telerik inside a skin project?

Thanks in advance

Pascal
Bozhidar
Telerik team
 answered on 29 Jul 2010
1 answer
105 views
There are cases where we need to set the RadAjaxManager with a lot of controls in order to get the right dynamic updates. Consider the following code:
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fShiftQty , fBalance , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fShiftQty , fHours , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fHours , fShiftQty , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fHours , fBalance , Progress1); RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fCrewSize , fCrewTotal , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fCrewSize , fCrewTemps , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fCrewSize , fCrewPeople , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(btnSave2 , btnSave2 , Progress1);
(RAMPUC=RadAjaxManagerProxy for UserControl)
It's basic and effective, but wordy and redundant, right? And a complex page can have a lot more of those lines. So here's an alternative:
SetAjaxUpdates( new Control[ , ] {
        {fShiftQty, fBalance},
        {fShiftQty, fHours},
        {fHours , fShiftQty},
        {fHours , fBalance} , 
        {fCrewSize , fCrewTotal} ,
        {fCrewSize , fCrewTemps} ,
        {fCrewSize , fCrewPeople },
        {btnSave2 , btnSave2}
    }
);

And here's the method:
void SetAjaxUpdates( Control[ , ] controls )
{
    for ( int i = 0 ; i <= controls.GetUpperBound(0) ; i++ )
        RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(
             controls[ i , 0 ] , controls[ i , 1 ] , Progress1);
}

Assuming that in this case I do want Progress1 to be active for all updates, from a readability perspective do other people here find the alternative preferable to the original? Or am I just adding more code where it's not necessary and abstracting/refactoring into even more complexity?

More importantly, this is what I came up with to try to streamline the code a bit, and make adding new trigger/update relationships easier, but is there a better, or more elegant way to do what I'm doing here?

Opinions?  Thanks!
Maria Ilieva
Telerik team
 answered on 29 Jul 2010
5 answers
182 views

 

 

<telerik:RadGrid runat="server" ID="grdDetails"

 

 

 

 

Skin="Vista" EnableAJAX="true" Height="100%" BorderWidth="0"

 

 

 

 

AllowSorting="true" Style="outline: none" ShowGroupPanel="true"

 

 

 

 

Width="100%" oncancelcommand="cancleGrdetails" oneditcommand="bindGrdetails1"

 

 

 

 

onupdatecommand="updategrdetails">

 

 

  

 

 

<MasterTableView AutoGenerateColumns="false" EditMode="PopUp">

 

 

 

 

 

<Columns>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="Name" HeaderText="Name"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="EntityId" HeaderText="EntityId"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="Jurisdiction" HeaderText="Jurisdiction"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="EventType" HeaderText="EventType"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="StartDate" HeaderText="StartDate"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="EndDate" HeaderText="EndDate"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridEditCommandColumn HeaderText="Edit" UniqueName="Editrow"></telerik:GridEditCommandColumn>

 

 

 

 

 

</Columns>

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

<clientsettings>

 

 

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

 

 

</clientsettings>

 

 

 

 

</telerik:RadGrid>

 

 

 

 

 

protected void bindGrdetails(object sender, EventArgs e)

 

{

 

 

//grdDetails.DataSource = null;

 

 

grdDetails.DataSource =

 

 

"edit".Split();

 

 grdDetails.DataBind();

grdDetails.Visible =

 

true;

 

 

}

 

 

 

protected void bindGrdetails1(object source, GridCommandEventArgs e)

 

 {

grdDetails.Visible =

 

true;

 

 bindGrdetails(source, e);

  

}

 

 

 

protected void updategrdetails(object source, EventArgs e)

 

{

bindGrdetails(source, e);

}

 

 

 

protected void cancleGrdetails(object source, EventArgs e)

 

{

bindGrdetails(source, e);

}

 




In the above when i click on edit i get an error "Specified argument was out of the range of valid values"(In case of in place edit mode)

When edit mode is popup....the form fields are not editable...they are readonly......
I tried a lot but couldn't find the solution....

Ashish Gupta
Ashish
Top achievements
Rank 1
 answered on 29 Jul 2010
5 answers
436 views
Hi all,

i have a grid with an object DataSource.
This DataSource read a table with date write in integer format like that: 20100721.
I want to know if is possible to display in DateTime format 21/07/2010 and edit with a RadDateTimePicher.

Thanks in advance.

Riccardo Fanetti
Tsvetoslav
Telerik team
 answered on 29 Jul 2010
3 answers
3.7K+ views
Hello,

I'm sure there is a very simple solution to my probleme that I am overlooking, but any help would be greatly appreciated.  Basically, I am using the RadDatePicker on a form.  When the form loads it is set to the current date (DateTime.Now), but there is no visual indication of this on the control. I need the RadDatePicker.DateInput.Text to display from the get go and it would be even better if the selected date would be highlighted in the popup calendar as well.  As is, the text only fills in after the user goes in and changes the date(same with the highlight on the calendar date. Is there some property that allows the date to be displayed before the date changes?
 
Thanks in advance,

Morgan
Muthusamy V
Top achievements
Rank 1
 answered on 29 Jul 2010
3 answers
353 views
I have a rad toolbar inside commanditemtemplate, it wont show, am I missing on some property? 
Its with any control I place in there.

On the client side on which event can I access the commanditemtemplate?
Daniel
Telerik team
 answered on 29 Jul 2010
2 answers
221 views
Hi All

I need some advice on RAD Grid. I am using edit form template within Rad Grid and within Edit form template I have a panel and a check box. My requirement is I want to enable or disable the panel depending upon the checkbox change. I want to enable the panel when checkbox is selected and disable the panel when checkbox is not seletected.

This is what i am trying to do

    Protected Sub chkEnablePanel(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim chkEnablePanel As CheckBox = CType(sender, CheckBox)
        Dim contactPanel As Panel = CType(RadGridAccContacts.FindControl("Panel1"), Panel)
        If chkEnablePanel.Checked = True Then
            contactPanel.Enabled = True
        Else
            contactPanel.Enabled = False
        End If
    End Sub

<asp:CheckBox ID="chkActivateContact" runat="server" Visible="False" Font-Bold="true"  AutoPostBack="true"
                                        ForeColor="Red" Text="Re-Activate Contact" OnCheckedChanged="chkEnablePanel"  />

Please advice how to find out the child control in edit form template of Rad Grid.

Thanks




Edward
Top achievements
Rank 1
 answered on 29 Jul 2010
3 answers
187 views
Hai,

Unable to edit the ID attribute of Telerik.Web.UI.RadTreeNode.

How can we distinguish between different nodes without setting the ID for individual nodes. I want to perform different set of actions on clicking each nodes.
Yana
Telerik team
 answered on 29 Jul 2010
1 answer
92 views
Hello,

I just had a question about the Rad Calendar Control.

I can successfully get a list of selected dates from the control, and insert them into my Database. 

But I would like to implement it so that when the page with the control is loaded, any currently

selected dates found  in the database will be automatically selected on the Rad Calendar.  

Currently i have the dates i would like selected in the Rad Calendar's Selected Dates property.

I have everything working except actually displaying the Dates in the Rad Calendar.  

Is there a specific way to do this?  


Thanks,

Steve
Daniel
Telerik team
 answered on 29 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?