Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Related to Datawindow(Very Urgent)

Posted on 2003-02-25
9
Medium Priority
?
1,218 Views
Last Modified: 2013-12-26
Hi
    My question is as fallows:
  I have one datawindow,in which i retrieve data from three tables,i just wanted to click the pericular row,and insert no of rows afetr that row,which should be blank,i wanted to enter new data in it,One of field of datawindow is dropdowndatawindow,so that field should be present in blank rows too,plz hepl me ,plz give a code for it,
Thanks in advance,i hope u will help me soon..
Regards
 Sanika
0
Comment
Question by:sanika
7 Comments
 

Expert Comment

by:PBMister
ID: 8022742
A quick way is to put an insert button in the header band of your datawindow.
Set the button's action to Insert Row.
Check the 'Use Action Default Picture' check box.
There is no need for code.

Good luck
0
 
LVL 4

Accepted Solution

by:
Bhatti earned 200 total points
ID: 8024118
Here is code:

In the clicked event of the dw.

//variable
datawindowchild   ldwc_child

dw_1.GetChild("column_name", ldwc_child)
ldwc_child.SetTransObject(SQLCA)

dw_1.InsertRow(row)
ldwc_child.InsertRow(1)

// row is the paste argument of the clicked event, let it as it is.

copy the code in your dw clicked event and just put the name of the column in the column_name in quet ("").

in the place of "column_name" name of the column of the dw where you placed dddw.
in place of the dw_1 name of your datawindow.


Best regards


Bhatti
0
 
LVL 2

Expert Comment

by:Caseys95
ID: 8027337
This should be very simple.

In the Clicked event of the datawindow all you should have to do is an InsertRow()

You may want to check that the click occured on a row and not in the header or other area of the DW.

// checks the current row number
If row > 0 Then This.InsertRow( Row )

or

// Checks the DWO
If IsValid(DWO) then
  Choose Case DWO.Type
    Case 'column', 'compute', 'test' ...
       ll_Row = This.Insertrow( Row )
  end choose
end if

The data for the DDDW is shared between all the rows of the DW. This data (list) will be available after the retrieve of the parent DW and will automatically be there for the newly inserted row. You may not immedialty realize this if you do not have a value in the DDDW that relates to NULL.

You can set the default value by

This.Object.MyDDDWCol[ll_Row] = <default Value>

Hope this helps

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:EAServer
ID: 8027463
I am not sure why everyone is making this so difficult...Put the following in the clicked event of your datawindow...

IF row < 1 THEN RETURN //No row was clicked so just return
This.InsertRow(row + 1)

That's it two lines of code are all that is needed.


That's it two lines of code are all that is needed.  Now this code is going to add a new row every time you click on a row, are you sure that is what you want?
0
 
LVL 4

Expert Comment

by:Bhatti
ID: 8035505
You have a window
In this window you put a dw control
This dw is named dw_1. (if you have another)
Now you paste here datawindow object, made from three tables
This datawindow object made from different columns
In one column you edit a dddw. (WHAT IS NAME OF THIS COLUMN??)

First in the instance variable declare
datawindowchild  idwc_child

Now in the constructor event of the dw_1 put the code:

THIS.SetTransObject(SQLCA)
THIS.GetChild("NAME OF THE COLUMN", idwc_child)
idwc_child.SetTransObject(SQLCA)

Now in the clicked event of the dw_1 put the following code:

IF row > 0 THEN
   dw_1.InsertRow(row + 1)
   ldwc_child.InsertRow(1)
EBD IF

If you need further explaination please let me know.

Best regards


Bhatti
0
 
LVL 2

Expert Comment

by:EAServer
ID: 8035657
bhatti
I don't think the poster wants to insert a blank row in the dropdown.  I just think he wants the dropdown to work correctly on the blank row, which PB does for you automatically.  So no need for any of the GetChild stuff...Just a simple InsertRow(row + 1) in the parent is all that is needed.
0
 
LVL 4

Expert Comment

by:Bhatti
ID: 8037607
EAServer,

I don't know how to collect the answer, but she wrote she want also a new row in dddw. When every time use clicked on the row then dddw insert in it a new row. WHY?

So I write in code to insertrow in the dddw.

Thanks for comments.

Best regards

Bhatti
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question