Re: Grid in email
- From: "tshad" <tscheiderich@xxxxxxxxxxxxxxx>
- Date: Tue, 10 Jan 2006 17:33:35 -0800
"Siva M" <shiva_sm@xxxxxxxxxxxxxxxxx> wrote in message
news:e7k5bijDGHA.140@xxxxxxxxxxxxxxxxxxxxxxx
> Well, there is way to do it:
>
> System.Text.StringBuilder sb = new System.Text.StringBuilder();
> StringWriter sw = new StringWriter(sb);
> HtmlTextWriter htw = new HtmlTextWriter(sw);
> DataGrid.RenderControl(htw);
That sounds interesting.
Would I do this in my Page_load or PostBack after Binding the DataGrid?
I assume it would be something like:
dbReader = myDbObject.RunProcedure("GetEmployerFavorites", parameters)
<--Gets my data
SubmissionsGrid.DataSource = dbReader
SubmissionsGrid.DataBind()
<-- Bind the data to the datagrid
System.Text.StringBuilder sb = new System.Text.StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htw = new HtmlTextWriter(sw);
DataGrid.RenderControl(htw);
I can now take SB and combine it with my email and send it to someone ?
Thanks,
Tom
> // Now, sb.ToString() will get you the HTML for the DataGrid.
>
> "tshad" <tfs@xxxxxxxxxxxxxx> wrote in message
> news:O2WQY5PDGHA.140@xxxxxxxxxxxxxxxxxxxxxxx
> So it has to be done by hand then.
>
> I was hoping there was someway to use a Datagrid or datalist to create the
> table and put the table into the body of the message.
>
> Thanks,
>
> Tom
> "Siva M" <shiva_sm@xxxxxxxxxxxxxxxxx> wrote in message
> news:eQ46j0IDGHA.740@xxxxxxxxxxxxxxxxxxxxxxx
>> Create the HTML markup for the table and use it as the body for the
>> email.
>> The email should have the body content type as HTML
>>
>> "tshad" <tfs@xxxxxxxxxxxxxx> wrote in message
>> news:OtPRVqHDGHA.2912@xxxxxxxxxxxxxxxxxxxxxxx
>> Is there a way to easily put a Datagrid in an email?
>>
>> I want to send a select result in the form of a Datagrid via an email to
>> some of our clients.
>>
>> Thanks,
>>
>> Tom
>>
>>
>>
>
>
>
.
- Prev by Date: Re: dbReader closing prematurely
- Next by Date: Re: Your favorite tutorial for caching viewstate?
- Previous by thread: 2.0 conversion : w3wp.exe using GOBS of memory
- Next by thread: DataSource
- Index(es):
Relevant Pages
|