This is a migrated thread and some comments may be shown as answers.

Value cannot be null. Parameter name: value

1 Answer 528 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
ALEX
Top achievements
Rank 1
ALEX asked on 13 Jan 2017, 09:35 AM

Hi Team,

           I'm facing this error "Value cannot be null. Parameter name: value" when i import the "docx" to richtextbox. I refer this Link for sample code. I can read below code for some file but some are not.

Here is sample Code

private void button1_Click(object sender, EventArgs e)
{
    RadDocument document = new RadDocument();
    IDocumentFormatProvider provider = new DocxFormatProvider();
    OpenFileDialog openDialog = new OpenFileDialog();
    openDialog.Filter = "Documents|*.docx";
    openDialog.Multiselect = false;
    DialogResult dialogResult = openDialog.ShowDialog();
    if (dialogResult ==  System.Windows.Forms.DialogResult.OK)
    {
        using (Stream stream = openDialog.OpenFile())
        {
            document = provider.Import(stream);
            radRichTextBox1.Document = document;
        }
    }           
}

 

I do not know this is the file issue or not. I'm using V2011.3.11.1219 WinForms. I attached the file that can not read from code. You need to change the extension to docx.

 

Regards,

 

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 13 Jan 2017, 11:46 AM
Hello Alex,

Thank you for writing.

Please note that the old RadRichTextBox control is now deprecated. Please upgrade to use RadRichTextEditor which has no issues opening the file.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
RichTextEditor
Asked by
ALEX
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or