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

Hi,

I've a radgrid.I need to have 2 columns one is a datacolumnand other one is a  griddropdown column.
Can i use a datatable, datarow method to populate the grid and update it.

I need griddriopdown column as second column ????

The first column is a datacolumn  If i first declare datacolumn in .cs and then
 in .ascx , under columns i create a griddropdown column, the griddrop down column is appearing as first column
but i need griddrop down column to appear as second column and my datacolumn as first column??
how is it possible.

Even if i have 1 datacolumn and 1 griddropdown column, cani use a datatable to populte data for them??
 can you help me with code

Princy
Top achievements
Rank 2
 answered on 03 Aug 2009
0 answers
182 views
hi,

i am using combo box as the input for the birthdate for my program. i had using the related combobox as my reference for my work. i have 3 combobox, that is year, month and day. It look alright when i have select the year and loop for the month. But i face a problem, i can't get the selected value for the year combo box when i wan to loop for the days. This lead me cannot get the value for day espeacially in february. Its can't count on the leap year. if i am using the postback, these doesn't happend. below is my code:

aspx:

<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="radComboBoxWMDY.aspx.cs" Inherits="radComboBoxWMDY" %>  

 

 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

 

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

 

<

 

html xmlns="http://www.w3.org/1999/xhtml">

 

 

<

 

head runat="server">

 

 

<title></title>

</

 

head> 

 

 

<

 

body>

 

 

 

<form id="form1" runat="server">

 

 

 

<div>

 

 

 

<asp:ScriptManager ID="ScriptManager1" runat="server">

 

 

 

</asp:ScriptManager>

 

 

 

Year:

 

 

<telerik:RadComboBox ID="rcbYear" runat="server" onselectedindexchanged="rcbYear_SelectedIndexChanged"

 

 

 

OnClientSelectedIndexChanging="LoadMonth"  onitemsrequested="rcbYear_ItemsRequested"> </telerik:RadComboBox>

 

 

 

Month:

 

 

<telerik:RadComboBox ID="rcbMonth" runat="server" onselectedindexchanged="rcbMonth_SelectedIndexChanged" OnClientSelectedIndexChanging="LoadDay" OnClientItemsRequested="ItemsLoaded" onitemsrequested="rcbMonth_ItemsRequested">

 

 

</telerik:RadComboBox>

 

 

 

Day:

 

 

<telerik:RadComboBox ID="rcbDay" runat="server" OnClientItemsRequested="ItemsLoaded" onitemsrequested="rcbDay_ItemsRequested" onselectedindexchanged="rcbDay_SelectedIndexChanged" >

 

 

</telerik:RadComboBox>

 

 

 

<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />

 

 

 

<asp:Label ID="Label1" runat="server"></asp:Label>

 

 

 

</div>

 

 

 

</form>  

 

 

<script type="text/javascript">

 

//global variables for the countries and cities comboboxes

 

var

 

rcbMonth;  

 

 

var rcbDay;

 

 

var rcbYear;

 

 

 

function pageLoad()

 

 

{

 

 

// initialize the global variables

 

// in this event all client objects

 

// are already created and initialized

 

rcbMonth = $find(

"<%= rcbMonth.ClientID %>");  

 

 

rcbDay = $find(

"<%= rcbDay.ClientID %>");

 

 

 rcbYear = $find(

"<%= rcbYear.ClientID %>");

 

 

}

 

 

function

 

LoadMonth(combo, eventArqs)

 

 

 {

 

var item = eventArqs.get_item();

 

 

 rcbMonth.set_text(

"Loading...");

 

 

 rcbDay.clearSelection(); 

 

 

// if a continent is selected  

 

if (item.get_index() > 0)  

{ 

 

// this will fire the ItemsRequested event of the

 

// countries combobox passing the continentID as a parameter  

 

rcbMonth.requestItems(item.get_value(),

false);

 

 

}

 

 

else

 

{ 

// the -Select a continent- item was chosen

 

rcbMonth.set_text(

" ");  

 

 

rcbMonth.clearItems();

rcbDay.set_text(

" ");

 

 

 rcbDay.clearItems();

}

}

 

 

function

 

LoadDay(combo, eventArqs)  

 

 

{  

 

 

var item = eventArqs.get_item();  

 

//rcbDate.set_text("Loading...");  

 

// this will fire the ItemsRequested event of the

 

// cities combobox passing the countryID as a parameter

 

rcbDay.requestItems(item.get_value(),

false);  

 

 

}

 

 

function

 

ItemsLoaded(combo, eventArqs)

 

 

{

 

if (combo.get_items().get_count() > 0)  

 

 

{

 

 

// pre-select the first item  

 

combo.set_text(combo.get_items().getItem(0).get_text());

combo.get_items().getItem(0).highlight();

} 

//combo.showDropDown();  

 

} 

</script>

</

 

body>

 

 

 </

 

html>

the code behind:

 

 

using

 

System;

 

 

 

using System.Collections.Generic;

 

 

 

using System.Linq;
using System.Web;

 

 

 

 

using System.Web.UI;

 

 

 

using System.Web.UI.WebControls;

 

 

 

using System.Data;

 

 

 

using System.Configuration;

 

 

 

using System.Collections;

 

 

 

using System.Web.Security;  

 

 

 

using System.Web.UI.WebControls.WebParts;

 

 

using System.Web.UI.HtmlControls;  

 

 

 

usingTelerik.Web.UI;

 

 

 

public

 

partial class radComboBoxWMDY : System.Web.UI.Page

 

 

{

 

DateTime tnow = DateTime.Now;

 

 

int year, month,i , day;

 

protected void Page_Load(object sender, EventArgs e)  

 

 

{

 

if (!this.IsPostBack)  

 

 

{

LoadYear();

} 

}

 

 

private bool CheckLeap(int year)  

{

 

if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0))  

 

 

 

return true;  

 

else return false;  

}

 

 

//binding every month day  

 

private void BindDays(int year, int month)

{

 

int i;

 

ArrayList AlDay = new ArrayList();   

 

switch (month)

{

 

case 1:

 

case 3:

 

case 5:

 

case 7:

 

case 8:

 

case 10:  

 

 

 

case 12:

 

for (i = 1; i <= 31; i++)

AlDay.Add(i);

 

break;

 

case 2:

 

if (CheckLeap(year)) 

{

 

for (i = 1; i <= 29; i++)

AlDay.Add(i);

} 

 

else

 

{

for (i = 1; i <= 28; i++)

AlDay.Add(i);

}

 

break;   

 

case 4:

 

case 6:  

 

 

 

case 9:  

 

case 11:  

 

for (i = 1; i <= 30; i++)  

AlDay.Add(i); 

 

break;  

}

rcbDay.DataSource = AlDay;

rcbDay.DataBind();

}
 

 

 

protected void LoadYear()  

{ 

 

ArrayList AlYear = new ArrayList();  

 

for (i = 2002; i <= 2010; i++)

AlYear.Add(i);

rcbYear.DataSource = AlYear;

rcbYear.DataBind(); 

}

 

 

protected void LoadMonth(int year)

{

 

ArrayList AlMonth = new ArrayList();

 

for (i = 1; i <= 12; i++)

 AlMonth.Add(i);

rcbMonth.DataSource = AlMonth;

rcbMonth.DataBind();

}

 

 

 

protected void rcbYear_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)

{

year =

 

Int32.Parse(rcbYear.SelectedValue);

 

//month = Int32.Parse(rcbMonth.SelectedValue);

 

//BindDays(year, month);

 

}

 

protected void rcbMonth_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)

{

year =

Int32.Parse(rcbYear.SelectedValue);

 

 

 

month =

Int32.Parse(rcbMonth.SelectedValue);

 

 

 

//BindDays(year, month);

 

 

 

}

 

protected void rcbYear_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)

{

LoadYear();

}

 

 

protected void rcbMonth_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)

{

LoadMonth(

 

Int32.Parse(e.Text));

}

 

 

protected void rcbDay_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)

{

BindDays(year,

 

Int32.Parse(e.Text));

}

 

 

protected void Button1_Click(object sender, EventArgs e)

{ 

 

string s = string.Format("{0}, {1}, {2}", year, month, day);  

Label1.Text = s;

}

 

 

protected void rcbDay_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)

{

day =

Int32.Parse(rcbDay.SelectedValue);

 

 

 

}

}

hope i can get the respond from u all faster!!!thank you!!!

best regards:

 

sk

 

 

sk
Top achievements
Rank 1
 asked on 03 Aug 2009
3 answers
198 views
Hi,
I set my editor to a custom skin (copied from sunset skin).
URL: http://www.ximnet.com.my/aspnet35/admin/testeditorskin.aspx

However,
- I cannot see the image in the toolbar
- When I click Image Manager, there is a skin error related to "tree" in the popup.

How can I solve this? Thanks.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="testEditorSkin.aspx.vb" Inherits="admin_testEditorSkin" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title></title> 
     
</head> 
<body> 
    <form id="form1" runat="server"> 
    <telerik:radscriptmanager id="RSM" runat="server" /> 
    <link href="../Skins/abm/Editor.abm.css" rel="stylesheet" type="text/css" /> 
    <div> 
<telerik:radeditor EnableEmbeddedSkins="false" skin="abm"  runat="server" ID="tContent" AllowScripts="True" ContentFilters="None"></telerik:radeditor> 
    </div> 
    </form> 
</body> 
</html> 
HSLaw
Top achievements
Rank 1
 answered on 03 Aug 2009
1 answer
208 views
Hello.

Telerik version: 2009.2.701.20
Database: MySQL 5

I have a page with 2 controls, RadComboBox and RadGrid.

RadComboBox lists the tables I have in my database, databound onload. RadGrid then loads the table content via ajax.

Now problem comes when I want the Insert/Update/Delete functionality. So far all examples and demos I have found requires the use of declarative approach. I cannot do this when  I do not know exactly how many columns there will be, and what the column names are.

Although they share the same primary key, they may have additional columns.

Is this possible?
Shinu
Top achievements
Rank 2
 answered on 03 Aug 2009
7 answers
217 views
I have developed a very simple demo web site that allow a user to upload files, and then in code behind, I iterate through the 

RadUpload1.UploadedFiles object.  For each iteration of the loop, I am opening the file and doing some processing.  I am using the ProgressArea to show custom progress as I process the file on the web server.  This is working fine and the ProgressArea is displaying.

However, for the first part, where the file is being uploaded to the web server.  The progress area does not display.  It's not that the upload is too quick.  It takes about 80 seconds to upload.  But for all that time, the progress area does not display until the file is finally uploaded and the custom progress area starts.

Any idea why that would be?

Kamen Bundev
Telerik team
 answered on 03 Aug 2009
1 answer
69 views
Hi,

Can anyone tell me how to repopulate the grid based on dropdownlist selction changed. this dropdown is not part of grid.
 
It's a separate control by itself in the ascx. so, when i change values in this dropdown, my radgrid should bring corresponding values and bind to the radgrid. is it possible.
how do i implement this(c#).

Also, can someone tell when the grid's itemdataboud event will get called. To get this event called should i have radgrid.databind() ???
So, the radgrid should be filled first prior to calling this event right???
Thanks,
ZR
Shinu
Top achievements
Rank 2
 answered on 03 Aug 2009
3 answers
163 views
I got this compilation error when I try to use the data binding

 <telerik:RadScheduler runat="server" ID="DisplayAllBookings"
............
OnDataBinding="onDataBinding">

Here's my javascript:

        function onDataBinding(sender, arg) {
            alert("Data binding");
        }

I got this compilation error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'ASP.booking_displayallbooking_aspx' does not contain a definition for 'onDataBinding' and no extension method 'onDataBinding' accepting a first argument of type 'ASP.booking_displayallbooking_aspx' could be found (are you missing a using directive or an assembly reference?)

Can anyone explain why I got this and how to resolve the problem?

Another question: basically I gonna have different number on each time slot and I want to use different colors to display time slots with various number. What I try to do is to modify the color of each time slot upon DataBinding. Apart from writing scripts for OnDataBinding, is there any easier way to do this?

Thank you very much.



Peter
Telerik team
 answered on 03 Aug 2009
3 answers
95 views
I am developing a site that handles content based on the domain name requested.  Code in global.asax assigns a DeptID based on the domain.  In using the scheduler, I only want to show/handle appointments for this DeptID.  I think I need to treat this like a custom resource - but how do I implement that?  I see how the documentation handles Rooms and Users, but I don't want to expose DeptID for the user to make a choice, and all appointments need to be filtered/inserted/updated for this DeptID only.
Peter
Telerik team
 answered on 03 Aug 2009
0 answers
109 views

Hi –

 I am using telerik Rad Controls in a .NET 2.0 application. There is an ASP.net page in application which consists of below controls.

<%@ Register Assembly="RadPanelbar" Namespace="Telerik.WebControls" TagPrefix="radp" %>

<%@ Register Assembly="RadMenu" Namespace="Telerik.WebControls" TagPrefix="radm" %>

<%@ Register Assembly="RadMultiPage" Namespace="Telerik.WebControls" TagPrefix="radMP" %>

<%@ Register Assembly="RadTabStrip" Namespace="Telerik.WebControls" TagPrefix="radTS" %>

<%@ Register TagPrefix="radA" Namespace="Telerik.WebControls" Assembly="RadAjax.Net2" %>

RadPanelbar.dll – version 3.5.2.0

RadMenu.dll – version 3.6.2.0

RadMultiPage.dll – version 1.5.2.0

RadTabStrip.dll – version 2.5.2.0

RadAjax.Net2.dll – version 1.8.4.0

 

The page contains a menu with few tabs. For each tab an asp.net web user control (.ascx) is loaded. The web user controls contains rad data grids and other rad & standard VS controls where data is fetched from a database.  A Rad Ajax Manager is placed in the page to perform some validations. Rad Ajax Manager and Rad Ajax Panel is placed inside Web user controls to implement ajax functionality.

When loading this page a JavaScript error is thrown as “ ‘parentNode’ is null or not an object” for RadMenu_Global.js.  The script error is thrown in RadMenu_Global.js. This does not occur all the time and it happens so rarely and because of that reason i have not been able to reproduce the issue to identify the problem.

Any idea’s to resolve this issue?

Nirmal
Top achievements
Rank 1
 asked on 03 Aug 2009
1 answer
100 views

Hi,

1) I need a column in radgrid with a dropdownlist with runtimebinding of the values.
2) The column should always be in  the dropdownlist with the values.
3) The grid should not have edit command column.
4) Selected value of the dropdown should be from datasource of radgrid.

But my datasource is a list<class> . so, how do i set the datasourceid and datatext and datavalue  if it is a list<class>.
Pls do elp me with code.


I'm doing the foll:
in ascx,GridTemplateColumn

 

<telerik:GridTemplateColumn HeaderText="mycol" UniqueName ="temp1">

 

 

<ItemTemplate>

 

 

<asp:DropDownList ID="ddl" runat="server"></asp:DropDownList>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 


in ascx.cs:

in grid's itemdatabound event , i do this

if

 

(e.Item is GridDataItem)

 

{

 

GridDataItem item = (GridDataItem)e.Item;

 

 

DropDownList ddl1 = (DropDownList)item["temp1"].FindControl("ddl");

 

ddl1.DataSourceID = ?

ddl1.DataTextField =?


ddl1.DataValueField =?
ddl1.DataBind();

 

}


I don't know what to fill in the ? with. pls help me with code.


Princy
Top achievements
Rank 2
 answered on 03 Aug 2009
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?