473,385 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Casting user Control in Grid

Hi
I create user control to EditTemplate in DataGrid control
I need to cast to get correct type of the control like this

MyBox box=(MyBox) e.Item.Cells[0].Controls[0];
Usually if I need to add
protected MyBox idofcontrol;
Where I need to know exact id of the control. The is impossible with
DataGrid.
Any ideas how this can be done?
Thank you.
Shimon.
Nov 19 '05 #1
1 1042
OK. I found easy solution. FindControl() works just fine.
Thanks.
Shimon.
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:er**************@TK2MSFTNGP09.phx.gbl...
Hi
I create user control to EditTemplate in DataGrid control
I need to cast to get correct type of the control like this

MyBox box=(MyBox) e.Item.Cells[0].Controls[0];
Usually if I need to add
protected MyBox idofcontrol;
Where I need to know exact id of the control. The is impossible with
DataGrid.
Any ideas how this can be done?
Thank you.
Shimon.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: | last post by:
I have got two user controls with grids in it. And they have to work as a master detail Grids. And the main thing is i want the detail grid to appear when i click select bound button in the master...
0
by: Chris Millar | last post by:
I have a user control that i wish to extend to change the date when the user selects the numeric up down button. The code explains itself, hope someone can help. any ideas appreaciated.. ...
0
by: VM | last post by:
In my Windows application, I load an ascii file into a tableX and set the datagrid.DataSource = tableX. The problem begins when I try to retrieve the data from the grid in order to process the...
4
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
1
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the...
5
by: Doug Handler | last post by:
Hi, I have a form (Form1) that contains a tab control which one tab has a customer user control (UserControl1). When the user double-clicks on the grid hosted there a new user control is...
4
by: Eric | last post by:
I got a particular problem in visual studio 2005 There's a user control on page and I want to meka a cast like this MyPage mp=(MyPage)this.Page; Error is : cannot cast from...
6
by: ajk | last post by:
Hi I was wondering how to show different properties in design and run-mode for a user control? Is it possible to do this when implementing the System.ComponentModel.ICustomTypeDescriptor...
5
by: vovan | last post by:
I have set of controls (Textboxes, checkboxes etc) along with the Grid on Windows Form. I use BindingSource to populate both Grid and the set of Controls. User selects the record in the grid and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.