如何在运行时将数据添加到网格中的特定列中

发布于 2024-10-07 11:44:56 字数 752 浏览 1 评论 0原文

I have a rad grid, i have bounded the columns in the grid using GripBoundColumns which shows me dropdown cloumns when i edit the record, Insert/update/delete are working fine for me.


My question is it possible to insert new data into the column(Not the whole record just only to one column) when i edit the record.

For example...

suppose i have 5 columns (Client Name, Account No, Account name, account status, Custodian Dealer)

CustodianDealer is my drop down coloumn and data for it comes from different table

when i edit or insert a new record in the grid, i can select the existing Custodiandealers in the table.

now if i want to insert a new record to the custodianDealer table not to the grid, how can i acheive it
I have a rad grid, i have bounded the columns in the grid using GripBoundColumns which shows me dropdown cloumns when i edit the record, Insert/update/delete are working fine for me.


My question is it possible to insert new data into the column(Not the whole record just only to one column) when i edit the record.

For example...

suppose i have 5 columns (Client Name, Account No, Account name, account status, Custodian Dealer)

CustodianDealer is my drop down coloumn and data for it comes from different table

when i edit or insert a new record in the grid, i can select the existing Custodiandealers in the table.

now if i want to insert a new record to the custodianDealer table not to the grid, how can i acheive it

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

三岁铭 2024-10-14 11:44:56

在 ItemDataBound 事件中尝试类似的操作:

If TypeOf (e.Item) Is GridDataItem Then
    Dim GDI As GridDataItem = CType(e.Item, GridDataItem)

    GDI([ColumnNameAsString]).Text = "Some custom text"
End If

GridDataItem 本质上是一个 TableCell,因此您可以根据需要添加控件。

哦,如果我的符号还不清楚,“[ColumnNameAsString]”是您自己的列名称。

Try something like this within the ItemDataBound event:

If TypeOf (e.Item) Is GridDataItem Then
    Dim GDI As GridDataItem = CType(e.Item, GridDataItem)

    GDI([ColumnNameAsString]).Text = "Some custom text"
End If

The GridDataItem is essentially a TableCell, so you can add controls as needed.

Oh, and if it wasn't clear from my notation, "[ColumnNameAsString]" is your own column name.

我做我的改变 2024-10-14 11:44:56

连接网格插入命令并执行插入查询,该查询仅使用新条目更新 Custodiandealers 表。要在下拉编辑器中显示它,请确保新记录与网格主表源具有外部关系,就像 Custodiandealers 表中的其余项目一样。

Wire the grid insert command and execute an insert query which updates merely the Custodiandealers table with a new entry. To display it in the dropdown editor, make sure the new record has a foreign relation with the grid main table source as the rest of the items in the Custodiandealers table.

空气里的味道 2024-10-14 11:44:56

因此,如果我正确阅读您的问题,您将尝试根据编辑/插入期间所做的一些更改将记录插入 custodianDealer 表中。

如果是这种情况,您可以处理 ItemCommand 事件并根据这些更改更新数据表。

您能提供用例的具体细节吗?

So, if I'm reading your problem correctly, you are trying to insert a record into the custodianDealer table based on some changes made during edit/insert.

If that's the case, you can handle the ItemCommand event and update your datatable based on those changes.

Can you provide the exact details of the use case?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文