Interactive use of my webcontrol

T

ton

Hi,
I've developed (trying) to custom server web controls:
1) A list which shows in a table several rows from a database table. The
firts column has a button, which is meant to be clicked by the user to get
to edit the record.
2) The second control, also a composite control, is a recordcard, where I
show all the fields in the record. I'm using Label, Textbox, Checkbox and
dropdown lists to let the customer modifiy the data.

What I want is:
pushing on the button from a row I want that the card will be displayed. I
prefer in another form, but from what I've heard this is not possible.
Second best: show the data on the same form. The button handler an event,
the usercontrol than raises another event (which works because I modifiy a
label in the baseform with the correct data) And than the card should be
filled.
The procedure to do all these things: My first approach was that the webcard
allready existed on the form, but with no result.
Private Sub DbWebList1_ShowCard(ByVal RecordID As Integer, ByVal TableID As
dbOLEserver.dbTableNum) Handles DbWebList1.ShowCard

Dim dbWebcard1 As New dbWebCtl.dbWebCard

Label1.Text = "XXXXXXXXXX" + CStr(RecordID) + " " + CStr(TableID)

DbWebCard1.ID = RecordID

DbWebCard1.TableID = TableID

dbWebcard1.CreateCard("all", RecordID, TableID) 'this is double but I wanted
to set the right values

Controls.Add(dbWebcard1)

End Sub

Thanx
Ton
 
T

ton

Thank you for your reply. I do not think the proble is due to the developing
from a listcontrol. The problem is more to let several controls work
together.
So I grid control with a button to modifiy the record should after pressing
be replaced by another control (the recordcard), and after a save of a
cencel action again replaced by the datagrid.
At this moment the original state of the first occurence appears.
When showing just a grid, and no card (at the bottem of the screen)
I cant display the card, after pressing and the grid is gone.
I will continue experimenting, where I will use statevariable to achieve the
result, perhaps that this will bring the solution. If it does not work I'll
combine the 2 controls in one. But before I will do this I will praktise
with a very simple multi-purpose controls
If you have other suggestion or remarks please react.

Ton


Ton, I'm having difficulty following what you are trying to achieve.
Actually you could have easily used the dataGrid control. It provides this
same ability. And if the same control needed to be displayed on various
pages then you could have further placed the datagrid into a usercontrol and
solved this way. I understand you want to be able to click on a row and then
retrieve the id etc and this is possible with custom controls, but is a
lengthy process, however I have been able to achieve this nicely. At the
momement I dont know what the internals of your custom control look like and
what you have done which makes it hard to give you any direction besides
this little advice.

Your doing a lot of data manipulation and if you still want to go on with
the web custom control building whereas to using the already rich dataGrid
control then I suggest you try and make your control inherit from the
datagrid/datalist/repeater control and add the special functionality you
want here. This way you get a lot of built in funtionality for granted.
 
A

Alessandro Zifiglio

Ton, you underestimate the DataGrid Control. Actually you can do this very
easily with the built in features of the dataGrid. Please take another look
at the dataGrid again. The funtionality you mentioned, if i'm not wrong is
that you want controls to be dynamically replaced etc when clicking a button
to modify the grid for example, this can be very easily accomplished with
the dataGrid control when you go in edit mode, and displaying a cancel or
delete button, replacing the existing controls to read/write however you
want, whatever you want. Give the dataGrid control
another chance before you get into developing a custom control for this ;P
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top